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

Interaction axis options default in the samples is not xy #718

Closed
stockiNail opened this issue Apr 7, 2022 · 11 comments · Fixed by #719
Closed

Interaction axis options default in the samples is not xy #718

stockiNail opened this issue Apr 7, 2022 · 11 comments · Fixed by #719
Milestone

Comments

@stockiNail
Copy link
Collaborator

stockiNail commented Apr 7, 2022

Default interaction options in the samples are set to 'x' instead of 'xy' as expected.

interaction: {
mode: 'nearest',
axis: 'x',
intersect: false
},

@stockiNail stockiNail changed the title Interaction axis options default in CHART.JS is not xy as expected Interaction axis options default in the sample is not xy as expected Apr 7, 2022
@stockiNail stockiNail changed the title Interaction axis options default in the sample is not xy as expected Interaction axis options default in the samples is not xy as expected Apr 7, 2022
@stockiNail stockiNail added this to the 2.0.0 milestone Apr 7, 2022
@kurkle
Copy link
Member

kurkle commented Apr 7, 2022

Why is xy expected?

@stockiNail
Copy link
Collaborator Author

Well, because the samples, where the events are showed, seem to me to be implemented assuming there is axis: xy and not other axis options. Maybe I'm wrong and I can change the title, removing it.
The samples was developed where interaction wasn't implemented and then axis was XY and mode nearest even if not declared.

@kurkle
Copy link
Member

kurkle commented Apr 7, 2022

🤔 I only see one sample that this affects, maybe I'm wrong. But instead, it would be better to fix that 1 sample and also create new samples demonstrating how the different interaction modes can be used in this plugin.

@stockiNail
Copy link
Collaborator Author

Ok, doable. Nevertheless, my opinion as user, I'm expecting to go to the samples and to have the default chart options (in this case interaction is not) because if I'm adding the interaction to the sample, it seems the user should always do. But that's my point of view and maybe I'm wrong. Anyway, let me change the PR following your hint.

@stockiNail stockiNail changed the title Interaction axis options default in the samples is not xy as expected Interaction axis options default in the samples is not xy Apr 7, 2022
@kurkle
Copy link
Member

kurkle commented Apr 7, 2022

In that case the defaults override should be removed

@stockiNail
Copy link
Collaborator Author

That's the best solution for my perspective. But I don't want to force you to accept it if you have some doubts.

@kurkle
Copy link
Member

kurkle commented Apr 7, 2022

I'm ok removing the defaults and setting in the samples where required. Its better that way. I think the current defaults are to make the charts work in an opinionated way, which is not good.

@stockiNail
Copy link
Collaborator Author

I'm ok removing the defaults and setting in the samples where required. Its better that way. I think the current defaults are to make the charts work in an opinionated way, which is not good.

Already done

@stockiNail
Copy link
Collaborator Author

About additional sample... to show events, you need a console (I have seen there is already a sample). In my lib showcase, I use checkbox to enable and disable options in order to enable the user to see the different behaviors with different options. Here, correct if I'm wrong, you can use only buttons.

@kurkle
Copy link
Member

kurkle commented Apr 7, 2022

Yes, at least you need to use a button to trigger an change. I think you could use normal html elements and query their values in the action, but not sure if that is worth the effort.

@stockiNail
Copy link
Collaborator Author

Yes, at least you need to use a button to trigger an change. I think you could use normal html elements and query their values in the action, but not sure if that is worth the effort.

OK, let me close another issue, related to hide some elements methods and then I'll do an event sample

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.

2 participants