Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to set a minimum height on bars in HighStock

enter image description hereWe're working on a project that charts the sales per country for two groups. The challenge is that since our prototype is focused on the US the sales in the US always dwarf all other countries. What we'd like to do is set a minimum height for any bar that is >0 so that the user will be able to see all the bars and know to mouse over for the count on the hover state.

I've attached an image to show how the scale of the sales in the US makes the sales in the countries to the right look like 0. In most cases only the US appears but we never show a country along the bottom unless there is at least 1 sale.

Anyway to define a minimum height so that there is always some bar present? We tried adding a border but that didn't work in the case where there was such a small # of sales relative to the large bar.

Thanks!

like image 603
Bill Avatar asked Mar 18 '13 15:03

Bill


2 Answers

Yes, you can use minPointLength: http://api.highcharts.com/highstock#plotOptions.column.minPointLength

Unless the average viewer of this data is accustomed to working with log-scaled data, it is not a good idea to scale it that way. People will compare the length of the bars, as they should, and will have a completely unrealistic impression of the data.

The difference between 1 pixel and 0 pixels will be enough to show that there is a value there, but will not be enough to skew the data in any meaningful way, in most cases.

like image 171
jlbriggs Avatar answered Nov 03 '22 10:11

jlbriggs


One thing you could consider is using a logarithmic scale:

http://www.highcharts.com/demo/line-log-axis

yAxis: {
    type: 'logarithmic'
},

That would allow you to visualize the different heights even if one bar was several orders of magnitude greater than the others.

Anything else would be skewing your data if it really is so small that it can't be seen when you plot it initially.

like image 41
Ben McCormick Avatar answered Nov 03 '22 09:11

Ben McCormick