Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide a series from initially being displayed in Highcharts

Tags:

highcharts

I can hide a chart dynamically when the chart is displayed using series.setVisible( ).

However I want my chart series to be hidden when the chart is initially displayed (I only want the series data present for the tool tip). Is there a way to set the series visibility to false in the initial configuration.

like image 345
Britboy Avatar asked May 01 '13 13:05

Britboy


People also ask

How do I delete a series in Highcharts?

You could probably just iterate through the series and check the . name against your "passed in name" instead of scanning the document for "series_name". There really should be a chart. remove(series) (not just index, because the indices remap after you remove one).

How do I show no data available in Highcharts?

Just don't create the highchart and insert text saying "No Data Available". Without any code, this is the most help you're likely to get.

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.

Is it possible to pass multiple series in a chart in Highcharts?

Yes, you can. You could add more. If you get stack with implementing your project, please send us a minimal, verifiable demo in JSFiddle, so we could help you out with your code.


1 Answers

You can use the visible option of the serie definition.

visible: Boolean Set the initial visibility of the series. Defaults to true.

Code:

series: [{
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
    visible: false
}, {
    data: [129.9, 271.5, 306.4, 29.2, 544.0, 376.0, 435.6, 348.5, 216.4, 294.1, 35.6, 354.4],
    yAxis: 1,
    visible: false
}]

Here a working fiddle: http://jsfiddle.net/IrvinDominin/CkLLt/1/

like image 81
Irvin Dominin Avatar answered Sep 20 '22 14:09

Irvin Dominin