Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to break highchart bars for extreme values

In highcharts if there are two series, where the first series value is 20,0000 and the second series value is 20, then the second series becomes so small that it is almost invisible.

Is it possible to break the first bar so that second series become visible? Below is the desired output...

desired output

like image 706
Mubbasher Khaliq Avatar asked Jun 13 '12 11:06

Mubbasher Khaliq


2 Answers

At this time there is not a way to do this. See the HighCharts User Voice here.

like image 136
wergeld Avatar answered Nov 04 '22 14:11

wergeld


I have used a mathematic calculation in the past to solve this kinds of problems. Here is a couple of different examples:

VALUES: 220, 110, 55, 5

  • Normal Format
  • Square Root Format

VALUES: 1100, 220, 110, 55, 5

  • Normal Format
  • Square Root Format

What I do in the above examples to get low value series to show more is use the square root of all values. The data is sent as the square root rounded to the third decimal. Then I use the formatter on the yAxis label and tooltip to display the proper values.

Also, in the above examples, I am using whole numbers. When formatting the yAxis label and tooltip I am adding 1 and forcing them to an integer to get them back to the original needed number. This works great for whole numbers. If your data is not a whole number, then you would have to pass the entire result from the square root. Then of course not force it to an int.

like image 25
Linger Avatar answered Nov 04 '22 16:11

Linger