Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unexpected behavior when time scale min/max doesn't cover entire range of values #4562

Closed
moonchen opened this issue Jul 25, 2017 · 3 comments

Comments

@moonchen
Copy link

See this: https://jsfiddle.net/moonchen/hvzaabxn/6/

Expected Behavior

In the example above, I expect a trapezoid shape graph that spans 6:00:01.3 pm to 6:00:01.5 pm.

Current Behavior

Currently, the graph starts at 6:00:01.050 pm, and ends at 6:00:01.950pm. Notice the dark tick marks at the requested min/max values. Also, the background fill extends outside the graph area.

Possible Solution

I can hook afterBuildTicks to set axis.min and axis.max to their proper values, and manually construct the ticks array. This fixes the x-axis range, but doesn't fix the fill problem.

Steps to Reproduce (for bugs)

  1. Graph a data set using a time scale on the x-axis.
  2. Set the x-axis min or max to be inside the data's x range.

Context

I'm trying to draw a real-time graph that show time-series data. This bug shows up when data history exceeds my graph window. I want data history to exceed the graph window because I want the left-most line segment to be correct.

Environment

  • Chart.js version: 2.6.0
  • Browser name and version: Safari 10.1.2
@etimberg
Copy link
Member

I think some or all of these issues have been fixed in master. @simonbrunel and @benmccann have the details

@benmccann
Copy link
Contributor

Probably fixed by #4522

@simonbrunel
Copy link
Member

Fixed by #4522 (http://jsfiddle.net/hvzaabxn/7/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants