The label looks good in Highcharts 4 but after upgrading to Highcharts 5 I started to Ellipses.
The xAxis.label
property looks something like this. Is there any way I can force the label to render horizontally and drop if there is not enough room for them to be rendered ? I can't use step:1
labels: {
rotation: 0
}
Rotation value I'm using for different Label Angle options are below:
- Auto - I'm using
autoRatate:[-10, -20, -30, -40, -50, -60, -70, -80, -90]
- -- :
rotate:0
-- I've problem with this option - /// :
rotate:-45
- ||| :
rotate:90
- \\ :
rotate:45
So I fixed the issue by calculating the
step
size dynamically based on the width of thexAxis
.Here is my solution:
Call the function
_getLabelStep
and set the labelstep
size.labels:{step : this._getLabelStep()} style:{width : 80px}
To be able to calculate the
step
size based on thexAxis
container, We must have to have defined label width. i.w80px
in my case.Looks like
staggerLines
can take care of this, but needs to be set manually.Fiddle:
Reference: