Closed stockiNail closed 2 years ago
Why is xy
expected?
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.
🤔 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.
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.
In that case the defaults override should be removed
That's the best solution for my perspective. But I don't want to force you to accept it if you have some doubts.
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.
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
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.
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.
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
Default interaction options in the samples are set to 'x' instead of 'xy' as expected.
https://github.com/chartjs/chartjs-plugin-annotation/blob/70078ccbe49568f6a4106667ad008bef7edf5495/docs/scripts/defaults.js#L9-L13