20

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.

2 Answers 2

45

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/

3
  • The requirements say "I only want the series data present for the tool tip", and the above answer does not meet this requirement. I'd love to know if there's a way to do this, as I have the same problem. Jun 21, 2016 at 16:19
  • @pm_hce please can you explain more you requirement or possibly post an image of the result? Jun 24, 2016 at 6:15
  • Basically, there is no standard way to do this given Highcharts' current logic. I needed an extra set of (secondary) data to be show in the tooltip, but the series should not appear in the main chart. Jul 25, 2016 at 9:33
0

The only way to show extra data in the Tooltip is to use the pointFormatter:function(){} in the tooltip section of the configuration. You can pick the extra data you need from a set of data provided by the server that supplies data, but which you do not output as a series in the chart. You need to pick the value for the current date based on the current point in the graph and append it to the result of the tooltip formatter function.

This way, however, the extra data you want to show in the tooltip cannot appear as a line in the chart, as you aren't creating a series for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.