Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Pie- and Polar-area- charts don't get the correct onClick function #65

Closed
Joelius300 opened this issue Aug 31, 2019 · 0 comments · Fixed by #70
Closed

Pie- and Polar-area- charts don't get the correct onClick function #65

Joelius300 opened this issue Aug 31, 2019 · 0 comments · Fixed by #70
Assignees
Labels
bug Something isn't working

Comments

@Joelius300
Copy link
Owner

Joelius300 commented Aug 31, 2019

Describe the bug

When using pie or polar area chart, the wrong label-onclick function is wired up.
The global one thinks each label corresponds to one dataset. This is the case for all charts but pie and polar area.

This means a change in the js code. I will open a pull request soon.

Which Blazor project type is your bug related to?

  • Client-Side
  • Server-Side

To Reproduce

Steps to reproduce the behavior:

  1. Use any version with the current ChartJsInterop.js file
  2. Create a pie or polar area chart with a dataset
  3. Start the app and click on a label of the dataset
  4. See that nothing happens except a js-error

Expected behavior

This part of the dataset should be hidden.

Code example

Literally any pie or polar area charts including the examples we have in our app.

Additional information

This kind of stuff seems to only be able to be discovered by looking at the chart.js source (e.g. from here or just prettify the minified version in the browser).
There is also an issue with the function that generates labels. There was an issue for that in the original repo (here) which was "fixed" with this PR. However this PR just removes the fallbacks which makes it work but it's not ideal and might actually introduce bugs. I adapted the PR when I first started working on the library that's why we didn't see the issue. You need to do almost the exact samething for generateLabels as well as for onClick and it's actually also the same charts (pie and polar-area). I might do this in the same PR or in another one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant