Returns the specified X value of a series in the chart object (for XY-Scatter and XY-Curves).
float object->GetSeriesXValue( int index, int valueindex )
If the index argument refers to a series that does not exist in the chart object, the GetSeriesXValue method raises an out of bounds error.
If the valueindex argument refers to a X value that does not exist in the specified series, the GetSeriesXValue method raises an out of bounds error.
Note: This method is available when manipulating XY data series required for displaying XY-Curves and XY-Scatter. Note that the Chart type (ie: bar, column, line, etc.) is defined in the Swiff Chart style file (.scs) which must be loaded via the LoadStyle method.
The following PHP code illustrates use of the GetSeriesXValue method.
//Load a style for generating XY Curves $chart->LoadStyle( "C:\myXYCurveStyle.scs" ); //Load the series and display the result $chart->SetSeparators( ";", true ); $chart->SetDataFromQuery(); //Retrieve the number of series stored in the chart object $n_series= $chart->GetSeriesCount(); $n_categories= $chart->GetValuesCount(); if( $n_series == 0 ) print( "No series available" ); else { //Enumerate the series stored in the chart object for( $i = 0; $i < $n_series; ++$i ) { //Enumerate the XY points of the series for( $j = 0; $j < $n_categories; ++$j ) { $str= "Series[" . $i . "][" . $j . "]="; $str= $str . "(" . $chart->GetSeriesXValue($i, $j); $str= $str . ","; $str= $str . $chart->GetSeriesYValue($i, $j) . ")"; print( $str ); } } }
GetSeriesYValue Method | AddSeries Method | GetSeriesCount Method | SetSeriesXValuesFromString Method | SetSeriesXValuesFromArray Method
Applies To: Chart Object