I need to be able to hide a Highcharts series from a button rather than the legend (the reason is that I need to toggle multiple groups from one button: Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance? and for the reasons given in that post, I cannot use $(chart.series).each()
with jQuery.
None of the following expressions have any effect (my chart object is named chart
):
Chart.series.get(1).hide(); chart.series.get(1).hide(); $(chart.series[1]).hide(); $(chart.series["1"]).hide(); $(chart.series[1]).hide(); $(chart.series)["1"].hide(); $(chart.series)[1].hide();
Can someone please tell me how I can make a chart series hide if I know its index? Thanks.
Highchart by default puts a credits label in the lower right corner of the chart. This can be removed using credits option in your chart settings. will remove the highcharts.com logo.
credits: { enabled: false }, that will remove the "Highcharts.com" text from the bottom of the chart. @philfreo 'Credits: false' could produce a undefined error if highcharts didn't do proper checking.
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.
Set legend's layout, align and verticalAlign options as follows: legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', itemMarginTop: 10, itemMarginBottom: 10 }, By itemMarginTop/Bottom you can control the padding between the legend items.
This should work:
chart.series[index].hide()
Full example on jsfiddle
(UDP URL from Simen Echholt comment)
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