This library is a modification of the awesome ChartJs.Blazor library by mariusmuntean. It's supposed to add more functionality to the LineChart and generally make the library more complete.
Other
40
stars
6
forks
source link
Pie- and Polar-area- charts don't get the correct onClick function #65
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:
Use any version with the current ChartJsInterop.js file
Create a pie or polar area chart with a dataset
Start the app and click on a label of the dataset
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.
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?
To Reproduce
Steps to reproduce the behavior:
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.