stewx
Posts: 2
Joined: Thu Aug 27, 2015 1:31 pm

How can I hide zero-value columns?

I have a stacked column chart and I want to hide any columns where all the stacked values are = 0 because they display as blank space with an X axis label underneath. These empty columns take up space on the X axis of my chart. How can I hide the columns where the value is 0?

For example, with this JSFiddle example, consumption of Apples is 0, so I would like to hide it completely. Likewise, if I click on the legend so that John and Jane's data are hidden from the chart, Oranges will also be 0 so it should also be hidden. http://jsfiddle.net/stewx/6p94pvvk/
stewx
Posts: 2
Joined: Thu Aug 27, 2015 1:31 pm

Re: How can I hide zero-value columns?

Update: I have now written a function called updateChart() that re-processes all the series data and categories every time the legend is clicked. It would be really nice if HighCharts gave an option for this natively, but you can write the functionality yourself as well.
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: How can I hide zero-value columns?

To request a feature, please post a suggestion on UserVoice http://highcharts.uservoice.com/forums/55896-general, or vote for the ones that are already registered.
Kacper Madej
Highcharts Developer
wilksmatt
Posts: 1
Joined: Fri Jan 27, 2023 8:00 pm

Re: How can I hide zero-value columns?

stewx wrote: Thu Aug 27, 2015 5:31 pm Update: I have now written a function called updateChart() that re-processes all the series data and categories every time the legend is clicked. It would be really nice if HighCharts gave an option for this natively, but you can write the functionality yourself as well.
Would you mind providing the code you used for that? Thanks!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: How can I hide zero-value columns?

Hello and welcome to our forum!

There was a topic on the forum with a similar problem, the user later attached a demo with a solution to his message: viewtopic.php?t=36538

Let me know if that was what you were looking for!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”