Chart.js: [BUG] Bar Chart on a daily time scale. first and last bars are cut off?

Created on 9 May 2018  ·  4Comments  ·  Source: chartjs/Chart.js

Expected Behavior

I would expect the bar for each day to be fully visible in the bar chart.

Current Behavior

The first and last bar in the bar chart are cut off

Possible Solution

unsure. I've read the docs and can't seem to find an option that will shift the x axis.

Steps to Reproduce (for bugs)

  1. https://codepen.io/anon/pen/JvMBvR
  2. the April 25 and May 6 bars are cut off in the middle.

Context

It's a bit odd-looking. I have a feeling it's something to do with how the time series data is being set.

Environment

bug

Most helpful comment

Is there any way to adjust the padding when offset: true ? It creates very large spaces on the left and right for me.

All 4 comments

@simonbrunel I thought the bounds option was meant to fix this, but I tested it and nothing happened

I think you are looking for offset: true.

@simonbrunel oh geez. yeah, you're right – that did the trick. I don't know how I missed that.

Is there any way to adjust the padding when offset: true ? It creates very large spaces on the left and right for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benmccann picture benmccann  ·  3Comments

lbowers picture lbowers  ·  3Comments

frlinw picture frlinw  ·  3Comments

SylarRuby picture SylarRuby  ·  3Comments

lizbanach picture lizbanach  ·  3Comments