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

Scriptable context options aligned with Chart.js #155

Closed
stockiNail opened this issue Oct 31, 2019 · 2 comments
Closed

Scriptable context options aligned with Chart.js #155

stockiNail opened this issue Oct 31, 2019 · 2 comments

Comments

@stockiNail
Copy link
Contributor

In new Chart.Js version 2.9.x, there is a similar implementation of context.

In DataLabels there is:

active bool Whether the associated element is hovered

In Chart.js there is:

hover: true if hovered

What do you think to be aligned with Chart.JS, renaming it in hover ?

@simonbrunel
Copy link
Member

Hi @stockiNail.

The active context property for this plugin exists for almost two years (c9cab49) while hover in Chart.js exists for about one week so it doesn't really make sense to consider modifying this plugin since the impact on users would be too important (compared to modifying Chart.js). I also don't want to add both properties.

I chose active instead of hover(ed) because an element can be active while the mouse is not over the element (for example when hover.intersect: false, axis: 'y'). Maybe I don't understand correctly the term "hover" in that case so what does context.hover mean in English?!

Note that the Chart.js docs for onHover states: "Called in the context of the chart and passed the event and an array of active elements. So I would suggest to align Chart.js instead and rename the hover context property to active.

@stockiNail
Copy link
Contributor Author

@simonbrunel Thank you very much for your explanation.

I fully agree with you.
I assumed (wrongly) that scriptable options in CHART.js was taken from Datalabels plugin because they are very similar. And I was surprised to see the differences on the context.
I'm gonna raise the topic to Chart.js asa I can.

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

2 participants