How to get Highcharts X-Axis Categories starting at the left most point
A cleaner solution is to use the pointPlacement
reference provided in the Highchart API.
Add pointPlacement: 'on'
and you should be in business. (For reference, here is their example JSFiddle)
You can use spacingLeft and spacingRight to set the spacing:
chart: {
renderTo: 'chart1',
type: 'area',
spacingLeft: -21,
spacingRight: -21,
spacingBottom: 1
},
You can achieve the desired result by redefining labels.formatter on axis. jsFiddle is here.
But if you want to keep it simple and pass axis.categories
in traditional way (I think that this is a way more better), I suggest you to use a tiny hack and redefine an Axis.init
function. Try it on jsFiddle.
UPD: I've updated my previous fiddle a little. Check it out. I think that you can combine all my solution to get a nicer one.