seriesTemplate

Defines options for the series template.

Type: Object
Default Value: undefined

In most cases, you can organize the array that is assigned to the chart's dataSource option in the following way:

[
    {arg: arg1Value, series1Value: val11, series2Value: val12, ...}
    {arg: arg2Value, series1Value: val21, series2Value: val22, ...}
    ...
    {arg: argNValue, series1Value: valN1, series2Value: valN2, ...}
]

Each object that is included in the array represents an argument value and the values of all series for this argument.

However, there are some scenarios in which you do not know exactly how many series will be added. In these cases, you will not be able to define the data source in the manner detailed above. Instead, define it in the following way:

[
    {seriesName: series1, arg: arg11Value, val: value11 }
    {seriesName: series1, arg: arg12Value, val: value12 }
    ...
    {seriesName: seriesM, arg: argM1Value, val: valueM1 }
    {seriesName: seriesM, arg: argM2Value, val: valueM2 }
    ...
]

If you define a data source in this manner, set the argument and value fields using the argumentField and valueField properties of the commonSeriesSettings configuration object (for all series at once). In addition, define a template for the series using the seriesTemplate configuration object. Within this object, set the data source field that specifies the series name.

Define all series at once using the commonSeriesSettings object. If you need to specify individual values for options of a particular series, assign a callback function to the customizeSeries option of the seriesTemplate.

To see an example, refer to the Series Template demo.

customizeSeries

Specifies a callback function that returns a series object with individual series settings.

Type: function(seriesName)
Function parameters:
seriesName: String

The name of the series to be customized.

Return Value: Series configuration

A configuration object for the series.

Use this option to specify individual settings for a particular series.

To determine the series to which the function's return value will be applied, use the function's parameter. The parameter is set to the series name that is specified in the data source's field.

Show Example:
jQuery

In the following example, the customizeSeries option is used to set the specific options for the 2009 series.


                                    

                                    

nameField

Specifies a data source field that represents the series name.

Type: String
Default Value: 'series'

It is necessary to set the nameField option. The values of the data source field set to this option will be used as series identifiers.

Show Example:
jQuery

In this example, the year field of the data source represents the series name.