I have a line chart with several series. When viewed all at once the chart is confusing, so I would like to have certain series hidden initially.
I know I can programmatically turn off series, but is there a way to do this when initializing the chart?
setVisible() method, it will allow you to hide/unhide a selected series. Alternatively, you could use the series. hide() / series.
The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array. Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.
A series is a set of data, for example a line graph or one set of columns. All data plotted on a chart comes from the series object.
Defaults to rgba(51,92,173,0.25) .
Believe there is a configuration option for this.
Within Series, set "visible = false"
The legend will still list the series but greyed out. And the series itself will be hidden in the chart upon initial display.
Example configuration:
series: [{
name: 'HiddenByDefault',
legendIndex: 1,
visible: false,
color: '#4572A7',
type: 'spline',
data: [a, b, c],
tooltip: {
valueSuffix: ' ¥'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With