Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've set up a view to display a pie chart of my nodes by taxonomy type. How can I change the view to use % of total as the label on the individual slices rather than a count?
Comments
Comment #1
recidive CreditAttribution: recidive commentedYou may need to do something in the code. As this is not currently implemented.
But this is indeed a good feature request.
Moving to dev branch.
Comment #2
rsevero CreditAttribution: rsevero commentedThis must be implemented both in Views Charts and in Charts and Graphs.
I'm postponing it to a future version.
Comment #3
rsevero CreditAttribution: rsevero commentedAfter reviewing this issue I saw that Views Charts uses whatever labels you provide it. I'm not sure there is any need of extra support from Views Charts for this.
Marking it as fixed by now.
Please reopen with extra info if necessary.
Comment #5
justafishThis currently doesn't seem possible still? Could you please explain how to get the pie chart to use explicitly defined labels?
Thanks!
Comment #6
rsevero CreditAttribution: rsevero commentedViews Charts uses precisely what the View you defined provides.
So, to Views Charts show % labels, or absolutely any other label you might want, you have first to make Views return it, exactly as you want. To test this it might be easier to use the Table style instead of the Charts style until you manage to get the desired labels.
Once you managed to make Views return a field with the data with the exact format you desire in the labels and another field with the exact data you want to be used as data series, change the style from Table to Charts and set the x labels field to the first and the charts series to the second.