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

Tooltip support for CanvasPattern and CanvasGradient #5869

Merged
merged 1 commit into from Nov 29, 2018

Conversation

nagix
Copy link
Contributor

@nagix nagix commented Nov 29, 2018

This PR replaces mergeOpacity calls with ctx.globalAlpha to support CanvasPattern and CanvasGradient as tooltip item colors.

master: https://jsfiddle.net/nagix/hLn3uy5q/
tooltip1

master + This PR: https://jsfiddle.net/nagix/xc3vo2kh/
tooltip2

Fixes #4279

Copy link
Member

@simonbrunel simonbrunel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the use of the global opacity and the code simplification. In your fiddle, the tooltip with a pattern (second dataset) is a bit strange because the pattern seems to move in the tooltip box. But I guess that's a good choice since it works better with gradient (third dataset).

padding: 15
}
},
plugins: [{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, I never thought about using plugins to test interactions!

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

Successfully merging this pull request may close these issues.

None yet

3 participants