Chart.js: Stop Gridlines from expanding past last ticks

Created on 25 May 2016  Â·  13Comments  Â·  Source: chartjs/Chart.js

Is there a way to stop the gridlines from expanding past the final ticks?

screen shot 2016-05-25 at 12 28 39 pm
screen shot 2016-05-25 at 12 28 44 pm

help wanted bug

Most helpful comment

Agreed, I would love this feature. It's especially notorious if you have wide labels on the X-axis. (The extraneous lines in the areas marked by red below should be hide-able.)

image
(Link to fiddle used for this image: http://jsfiddle.net/rzwuq9vw/)

All 13 comments

There is a setting to disable these. I don't remember it off the top of my head.

Darn, I cant find it in the documentation anywhere.

This will do it

options: {
  scales: {
    xAxes: [{
      gridLines: {
        drawTicks: false
      }
    }]
  }
}

Right, that removes them from within the tick area, but I'm trying to remove are those at the edges:

screen shot 2016-05-25 at 12 28 39 pm

right, that's not possible. they're coming in because of the label padding

Darn, possibly they can add a feature for setting the first and last labels at the baseline.

+1 for this. Please fix it.

Agreed, I would love this feature. It's especially notorious if you have wide labels on the X-axis. (The extraneous lines in the areas marked by red below should be hide-able.)

image
(Link to fiddle used for this image: http://jsfiddle.net/rzwuq9vw/)

+1

Duplicate of #2478

@etimberg Looks like that's related to angled labels only. This bug is not. Are they the same root cause?

Not sure why it was closed either.

Sent from my iPhone

On Aug 25, 2016, at 1:26 AM, Eric [email protected] wrote:

@etimberg Looks like that's related to angled labels only. This bug is not. Are they the same root cause?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

They are the same root cause

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lizbanach picture lizbanach  Â·  3Comments

nanospeck picture nanospeck  Â·  3Comments

gabrieldesouza picture gabrieldesouza  Â·  3Comments

bytesnz picture bytesnz  Â·  3Comments

joebirkin picture joebirkin  Â·  3Comments