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] Release v2.7.3 scatter plot CanvasGradient #5839

Closed
chouhy opened this issue Nov 15, 2018 · 4 comments · Fixed by #5858
Closed

[BUG] Release v2.7.3 scatter plot CanvasGradient #5839

chouhy opened this issue Nov 15, 2018 · 4 comments · Fixed by #5858

Comments

@chouhy
Copy link

chouhy commented Nov 15, 2018

I believe in v2.7.3, something goes wrong.
I tried to apply CanvasGradient color to scatter plot and it just doesn't work.

At last, I changed to v2.7.2 and it worked.

v2.7.2
https://jsfiddle.net/b1embnd2/14/
v2.7.3
https://jsfiddle.net/b1embnd2/15/

Construction of the graph is completely same, the only difference is the version of chart.js.

@nagix
Copy link
Contributor

nagix commented Nov 19, 2018

Since v2.7.3, the origin of coordinates for CanvasGradient has become relative (#5319). In other words, the center of each point is (0, 0) for CanvasGradient.

@chouhy
Copy link
Author

chouhy commented Nov 20, 2018

Since v2.7.3, the origin of coordinates for CanvasGradient has become relative (#5319). In other words, the center of each point is (0, 0) for CanvasGradient.

I don't get what you mean. The center of each point has nothing to do with CanvasGradient.
In v2.7.3, CanvasGradient seems to apply color gradient INSIDE every point, i.e. https://jsfiddle.net/b1embnd2/22/ .
This is definitely not the correct behavior.
In previous version, the behavior of CanvasGradient acted like this.
default

@chouhy chouhy changed the title Release v2.7.3 scatter plot CanvasGradient bug [BUG] Release v2.7.3 scatter plot CanvasGradient Nov 20, 2018
@nagix
Copy link
Contributor

nagix commented Nov 21, 2018

Ok, this seems a common use case.

@simonbrunel #5319 uses ctx.translate and changed to draw points at (0, 0) to support rotation, but it causes this degradation. One solution would be to calculate each drawing point without ctx.translate or ctx.rotate, but I'm concerned that it could impact the rendering performance. Any ideas?

@simonbrunel
Copy link
Member

I don't know what's the best solution and I agree that calculating ourselves the rotated coordinates can have impact on performances. But we could try to benchmark how bad is it and see if it's an acceptable direction.

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.

3 participants