Skip to content Skip to sidebar Skip to footer

Highchart: Exact Distance Between Ticks

How to find out the exact distance or set an exact distance (to pixel) between two ticks on x-axis with Highchart? I have used tickPixelInterval, it does not seem to set the exact

Solution 1:

If you control the width of your chart, and control the width of your plot area using the margin settings, and you know how many ticks you are going to have in each chart, this is a simple matter.

So, chart 1:

width: 200,
margin: [10,25,50,75]

Two slots, each 50 pixels wide

Chart 2:

width: 600,
margin: [10,25,50,75]

10 slots, each 50 pixels wide.

Updated fiddle:

Output:

screenshot


Post a Comment for "Highchart: Exact Distance Between Ticks"