ZoomCharts Documentation
Switch to Version 2.0 (BETA)
Data series
series
setting is an array of one or more series that configures how the data is displayed.
Each series object takes one index from data values and displays as either columns or a line.
A typical series configuration would look like this:
series: [ { type: "line", style:{lineColor: "blue", lineWidth: 2}, data:{index:1, aggregation:"max"}, valueAxis: "default" }, { type: "columns", style:{fillColor: "red"}, data:{index:2, aggregation:"sum"} valueAxis: "default" } ]
In case when you haven't created your own series and when you want to style default or initial series, then you should look at seriesDefault object.
Type
Series type
option determines if it is displayed as line
or columns
.
Line and columns display has it's own set of default display parameters, found in chartTypes
setting.
Options defined in series overrides the defaults.
Data source
The data
section determines how data are acquired and processed before display.
Most important settings are:
index = 1
- index in the returned data arrays to use.aggregation = "sum"
- aggregation method to use if chart needs to aggregate multiple data values into one.noDataPolicy = "join"
- determines behavior if some time period has no data items.source = "default"
- specifies which data source to use if multiple data sources are available.
Value axis
ValueAxis
parameters specifies which value axis to use. Time chart supports unlimited number of axes, default being "default".
Stacking
To stack several series, you need to define a stack and assign series to it:
stacks: { "someStack": { name: "MyStack", type: "normal" } }, series: [ { type: "columns", style:{fillColor: "blue"}, data:{index:1}, stack: "someStack" }, { type: "columns", style:{fillColor: "red"}, data:{index:2}, stack: "someStack" } ]
Stacks maps stack id to stack configuration. To assign series to a stack, add stack:"stackId"
option.
Stack name
is the display name in info popup.
Stack type
can have the following values:
- "normal" - a regular stack, values of series are added up.
- "proportional" - absolute values shown as percentage of from sum of given stack.
- "based" - all series are aligned to zero line.