Accepted answer

it doesn't work for categorized axis - in that type,axis is divided into equal categories, so min/max padding isn't allowed.

possible solution is to use standard axis, but use formatter for axis, see:


you can use offset parameter for yaxis


i've come up with a workaround, but it is not perfect.

  1. separate the yaxis from the chart using yaxis.offset
  2. use extra-long tick marks to simulate the gridlines extending off to the left

like this:

yaxis: {
  offset: 30,
  ticklength: 30, // same value as offset
  tickposition: "inside",
  tickwidth: 1,
  tickcolor: "black", // the same as your gridline color
  labels: { 
    align: 'left',
    x: 0,
    y: -8 // position labels above their gridline/tickmark

for a demo, see

why it's not ideal

i want my gridlines to use a dash style (e.g. dashstyle: 'longdash'), but there doesn't appear to be a way to apply a dash style to tick marks.

i would love to hear if there's a way to do this, or a better workaround.

Related Query

More Query from same tag