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] Area is not filled correctly when steppedLine value is set #4696

Closed
nagix opened this issue Aug 25, 2017 · 1 comment · Fixed by #4697
Closed

[BUG] Area is not filled correctly when steppedLine value is set #4696

nagix opened this issue Aug 25, 2017 · 1 comment · Fixed by #4697
Milestone

Comments

@nagix
Copy link
Contributor

nagix commented Aug 25, 2017

Area between two lines is not filled correctly when the steppedLine value is set to 'before' or 'after'.

Expected Behavior

Area between lines should be filled without overruns or leaving unfilled area.

Current Behavior

Area between two lines is not filled correctly when the steppedLine value is set to 'before' or 'after'.

Possible Solution

Area curve is built here, but the steppedLine value is interpreted incorrectly because the path is created in reverse order. I think we can use the flip argument to change the behavior in helpers.canvas.lineTo.

// building opposite area curve (reverse)
for (i = len1 - 1; i > 0; --i) {
helpers.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);
}

Steps to Reproduce

See https://jsfiddle.net/5aszap5L/

Environment

  • Chart.js version: 2.6.0
  • Browser name and version: Chrome 60.0.3112.101, FireFox 54.0.1, Safari 10.1.2
@qiluo
Copy link

qiluo commented Aug 25, 2017

Verified in my case, fill perfectly working when stepLine enabled, appreciated!

@simonbrunel simonbrunel added this to the Version 2.7 milestone Aug 25, 2017
etimberg pushed a commit that referenced this issue Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants