Retrieves the number of series values and categories in the chart object.

int object->GetValuesCount( ) 

Arguments

object
Required. A Chart object.

Return Value

An integer value containing the number of values per series. This number is also the number of categories.

PHP Code Sample

The following PHP code illustrates use of the GetValuesCount method.

$values_1= array();
$values_2= array();

$values_1[0] = 10;
$values_1[1] = 20;

$values_2[0] = 100;
$values_2[1] = 200;
$values_2[2] = 300;

$chart->SetSeriesValuesFromArray(0, $values_1);

// count1 is now equal to 2
$count1= $chart->GetValuesCount();

$chart->SetSeriesValuesFromArray(1, $values_2);

// count2 is now equal to 3
$count2= $chart->GetValuesCount();

$categories= array();

$categories[0]= "Cat 1";
$categories[1]= "Cat 2";
$categories[2]= "Cat 3";
$categories[3]= "Cat 4";

$chart->SetCategoriesFromArray($categories);

// count3 is now equal to 4
$count3= $chart->GetValuesCount();

print("Count 1= " . $count1 . "<br>");
print("Count 2= " . $count2 . "<br>");
print("Count 3= " . $count3 . "<br>");

The result displayed in the Web Browser will be:

Count 1= 2
Count 2= 3
Count 3= 4

See Also

SetSeriesValuesFromString Method | SetSeriesValuesFromArray Method | SetCategoriesFromString Method | SetCategoriesFromArray Method | GetSeriesCount Method

Applies To: Chart Object