lucasc9x lucasc9x - 18 days ago 9
Javascript Question

Highcharts Line Chart - Some categories are not visible

I've been using the

highcharts
package to display an audiogram, my categories
array
is

['0.125' ,'0.250', '0.5, '0.750' , '1', '1.5', '2', '3', '4', '6', '8', '9', '11.2' , '12.5', '14', '16', '18', '20']


But when the chart is not wide enough (e.g. when I put 2 charts side by side), some categories
( 0.250 , 0.750, 1.5 ....)
become hidden as you can see in the image below:  [

What I need is all the categories to be shown despite the chart width, like this one:

enter image description here

Any help is appreciated.

UPDATE:

http://jsfiddle.net/5cbroe1f/

Here's the fiddle, both charts have the same data. As I said before, I need all the categories to be shown in the first chart (the smaller one).

Thanks!

Answer

For displaying each category's label you need to set xAxis.labels.step to 1.

xAxis: {
  categories: [],
  labels: {
    step: 1
  }
},
Comments