-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Label for each data set in pie chart #1417
Comments
Yeah, that's interesting. We didn't see much use of the multiple dataset pie in the first place, we just kinda put it in as an experiment and novelty and it worked great! Not really a breaking API change, so there's no rush. Really, a good idea. |
I've no code for the moment. The idea is to allow for labels in data.datasets.labels rather than data.labels. |
Adding |
Turns out we already had this functionality in @jibaku you can set |
It is still not possible to display which pie corresponds to which dataset (like in this picture). This would be very useful. |
@gentisaliu Looks like it has only been done for the Doughnut chart.
|
I know this is closed but this accomplishes what you are asking
|
I discovered you can put whatever arbitrary values in the dataset, so I just added a labels attribute to each dataset and updated the label callback. The legend is broken, but I would need to update how hiding works to remove data from the other data set when one slice is hidden anyway for full functionality. So hovering to see what the values are works well for me!
Now if only I could set the cutoutPercentage for each dataset as well... |
Hi.
For example, when i hover the yellow segment (belongs to the second dataset), 2 labels correspond with first item in 2 datasets appear. |
@dangkhoa12pfiev3 What version of chartjs are you using? I copied your code and put it in this jsfiddle and it's working fine for me in both chrome and firefox |
Hi, |
Hi, Recently I updated Chart.js and everything broke. Can someone help me with the below code. Here is an Example of old version : http://jsfiddle.net/x7q5tav6/1/ Old Version tooltips: {
New version label: function (context){
} Thank you. |
@andersonJordan please read the v3 migration guide |
I have tried to understand but couldn't figure out. I did try and wrote the new version that is compatible with 3.2.0 or should I say at least I thought it was compatible. Any help would be appreciated. Thank you. |
@andersonJordan idk where you got the property |
I have tried calling chart, it still hasn't worked for me. IDK where I'm going wrong. |
The correct configuration is:
|
I would like to know if it's possible to specify different labels for multiple data set in pie chart in the 2.0 alpha 3 version. If not, is it a contribution that would be interesting for the project ?
The text was updated successfully, but these errors were encountered: