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.

#### JSP Code Sample

The following JSP code illustrates use of the GetValuesCount method.

    int[] values_1= new int[2];
    int[] values_2= new int[3];

    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
    int count1= chart.GetValuesCount();

    chart.SetSeriesValuesFromArray(1, values_2);

    // count2 is now equal to 3
    int count2= chart.GetValuesCount();

    String[] categories= new String[4];

    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
    int count3= chart.GetValuesCount();

    out.println("Count 1= " + count1 + "<br>");
    out.println("Count 2= " + count2 + "<br>");
    out.println("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