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

Buggy lines with Dates & gaps #7574

Closed
jacobsorme opened this issue Jun 30, 2020 · 1 comment
Closed

Buggy lines with Dates & gaps #7574

jacobsorme opened this issue Jun 30, 2020 · 1 comment

Comments

@jacobsorme
Copy link
Contributor

Expected Behavior

I expect the data to be stacked on the Date of the data. Two data points at the same Date is expected to be stacked.

Current Behavior

The x-position of the data in the graph seem to be correctly positioned among the Dates. However, the y-position seem to still rely on the index - it does not change as the starting Date of the dataset changes (see images 2, 3 and 4). Note that the blue line always start at y-position 5.

Not only is the y-position buggy, but the area under the graphs look strange, and seem to work with the indices rather than the Dates. See image

image

Figure 1) Normal behavior, datasets start at same time.

image

Figure 2) Strange behavior, one dataset (blue) start at a time-offset.

image

Figure 3) Strange behavior, one dataset (blue) start at a large time-offset.

image

Figure 4) Strange behavior, one dataset (blue) start at a large time-offset. Now with fill-parameter of dataset set to origin instead of filling mode relative to dataset index.

image

Figure 5) No stacking. Chart for reference.

Possible Solution

This issue is similar to #6437 - indices and Dates seem to get mixed up. Parts of the graph seem to still rely on an index (like the stacking/area/height of line here) while other parts (the x-position here) relies on the Date.

I am more than willing to try and help with fix this, maybe with some help on what files to start looking at.

Steps to Reproduce

See JSbin

Context

I am trying to stack things that not necessarily start/exist on the same dates, data categories that come and go as
time passes.

Environment

  • Chart.js version: 2.9.3
  • Browser name and version: Safari
  • Link to your project:
@kurkle
Copy link
Member

kurkle commented Jun 30, 2020

This has been fixed in 3.0.0-alpha

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

3 participants