You must be logged in to post your query.
Home › Forums › Chart Support › Misaligned secondary axis ticks when hiding labels
Hiding axis labels with the labelFormatter as per:
https://canvasjs.com/forums/topic/hide-axis-label/#:~:text=You%20can%20use%20labelFormatter%20to,tick%20and%20axis%2Dlines%20respectively.
and having a large fixed height for the chart causes the secondary axis ticks to become misaligned.
See:
https://jsfiddle.net/CraPo/0jsq5eb7/13/
Comment out the labelFormatter on lines 15-17 to see the ticks realign.
@crapo,
Bounds of axis depends on multiple factors including the axis labels. In your case, ticks of axisY & axisY2 are not getting aligned as labels are shown for axisY, which takes up space towards the top of the axis & axisY2 doesn’t. You can overcome this either by reducing labelFontSize in axisY or by setting labelFontColor of axisY2 to be same as chart-background along with a negative margin. Please take a look at this updated JSFiddle for an example where ticks are aligning.
— Vishwas R Team CanvasJS
Thanks @vishwas!
You must be logged in to reply to this topic. Login/Register