The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
How to show percentage in pie chart?
I have 2 different groups in the pie chart and the results are aggregated.
I want to show the percentage of each group's sales, instead of the sum of the sales.
Also, if I use Marco to calculate the percentage of each store, how can I display both the sales and the percentage in the result (not the chart)?
Can anyone help me with it?
I want to show the percentage of each group's sales, instead of the sum of the sales.
Also, if I use Marco to calculate the percentage of each store, how can I display both the sales and the percentage in the result (not the chart)?
Can anyone help me with it?
Tagged:
0
Best Answers
-
Marco_Boeck Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM EngineeringHi,
I'm afraid it's not obvious, but it is doable!
You have to go to Plot style -> Labels style -> and enter "<b>{point.name}</b>: {point.percentage:.1f}%" as the Label value format.
For the tooltip, you can add something like " => {point.percentage:.1f}%" as the tooltip Value suffix.
Regards,
Marco6 -
LilC Member Posts: 24 Learner IHi, Marco, if it is for Sunburst chart, will it work as well?
Also, since some are less than 0.9% of the total, if there any way to display them as well?
0 -
Marco_Boeck Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM EngineeringHi,
No, Sunburst does not support %. I suppose because it is usually very crowded with dozens of elements..
Regarding your other question, the available space is determined by the library. I would assume it thinks there is not enough space and therefore does not show those anymore. You have too many small elements in the same space for the labels to be shown properly in a pie chart, if you ask me. Those would make the chart not very nice, even if they did fit on the screen.
Regards,
Marco1
Answers
Because I really need to show those top 10 stores' individual percentage.
Is there a way to display them on the side of the bar chart?
If not I'll just use macro to add a column.
Yes, you can specify the colors via hex code. You need to manually modify the configuration file, though. See the attached configuration for the Iris sample data set. It uses a simple red/green/blue color array in line #119 for the colors element of the styleConfiguration of the plotConfiguration.
The font itself however cannot be specified unfortunately.
Kind regards,
Marco