"addSeries"

This function adds a series.

Synopsis

int shape.addSeries(dyn_float values[, dyn_string names])

Parameters

Parameter Description
values values of a series
names optional; names of the items

Return Value

The function returns the series number for the created series.

Description

The function adds a series. The optional names are the names which are attached to the values (every value represents an item). The item names are shown in the legend of the chartTypes: Donut, DonutBars.

In the charTypes Bars, StackedBars, PercentStackedBars the item names of the first series

(index == 0) are shown below the bars as segment labels.

Example

In the following example, two series were created, where the elements have no name. Furthermore, the colors of the series were changed.

main()
{
  dyn_float one;
  one[1] = 20;
  one[2] = 60;
  one[3] = 50;
  one[4] = 10;
  this.addSeries(one);
  this.setSeriesFillColor(0, "{255,181,53}");
  dyn_float two;
  two[1] = 30;
  two[2] = 25;
  two[3] = 15;
  this.addSeries(two);
  this.setSeriesFillColor(1, "{255,78, 87}");
}
Figure 1. Two new series with new colors

Assignment

Chart.ewo