Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable series through configuration in highcharts

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?

like image 743
cfs Avatar asked May 09 '13 18:05

cfs


People also ask

How do you hide a series in Highcharts?

setVisible() method, it will allow you to hide/unhide a selected series. Alternatively, you could use the series. hide() / series.

What is plotOptions in Highcharts?

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.

What is Highchart series?

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.

What is the default chart type in Highcharts?

Defaults to rgba(51,92,173,0.25) .


1 Answers

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: ' ¥'
            }

        }
like image 87
arcseldon Avatar answered Sep 28 '22 05:09

arcseldon