0

I wonder if there's an alternative way of displaying the negative values on the column chart.

The bottom most value on the y axis should be the lowest value. The columns on the graph should grow from the bottom and upward to their corresponding values.

See images below with the current and expected behavior.

Current Expected

Community
  • 1
  • 1
  • That's a very counter intuitive way of displaying data that breaks the expectation a user has about how to read a bar chart. I would very strongly suggest *not* displaying data in this manner. If there is a reason for negatives not to be displayed as negatives, I would work with methods of transforming the data in a way that makes sense to compare in a bar chart, or finding a different method of comparison. – jlbriggs Dec 31 '18 at 14:42

2 Answers2

1

It will be best if you use threshold property:

series: [{
    ...
    threshold: -20
}]

Live demo: http://jsfiddle.net/BlackLabel/0moe5q2y/

API Reference: https://api.highcharts.com/highcharts/series.column.threshold

ppotaczek
  • 36,341
  • 2
  • 14
  • 24
0

I'm not into highcharts really, but I've lurked a bit and figured out this little, lets call it, hack ;p

Check this out please: https://jsfiddle.net/4goq1x6c/

If you want the min value to be set dynamically you could calculate it based on some condition and update every 0 element of the data's arrays and the min value of yAxis. (i.e. you could use some variable for simplification)

It's dirty (but not as much when I've looked again on it) I know it, but I haven't found anything native in highcharts docs. I hope it will be useful :)

Papi
  • 741
  • 6
  • 8
  • This is exactly what I'm looking for, using another chart type and the hack above solved the issue. Thanks a lot and happy new year! – donny_barko Dec 30 '18 at 15:24
  • @borko I'm glad I could help. If the answer solved your issue please accept/upvote it so it could be closed. Happy new year and happy coding :) – Papi Dec 30 '18 at 19:13