Community & Support
Learn
Marketplace
Discussions
Categories
Discussions
General
Platform
Academic
Partner
Regional
Explore Siemens Communities
User Groups
Documentation
Events
Altair Exchange
Share or Download Projects
Resources
News & Instructions
Programs
YouTube
Employee Resources
This tab can be seen by employees only. Please do not share these resources externally.
Groups
Join a User Group
Support
Home
Discussions
Community Q&A
How to show percentage in pie chart?
LilC
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?
Find more posts tagged with
AI Studio
Visualization + Dashboards
Accepted answers
Marco_Boeck
Hi,
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,
Marco
LilC
Hi, 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?
Marco_Boeck
Hi,
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,
Marco
All comments
Marco_Boeck
Hi,
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,
Marco
LilC
Hi, 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?
Marco_Boeck
Hi,
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,
Marco
LilC
Thanks, Marco, you are awesome.
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.
Loan_Nguyen56
I want to show that in Rapid, please hep me. Thanks.
ksgenzer
Hi
@Marco_Boeck
, is there a way to specify pie chart colors using hex codes? And can you specify the font (not just the size) for the labels?
Marco_Boeck
Hi
@ksgenzer
,
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.
"colors" : ["#ff0000", "#00ff00", "#0000ff"],
The font itself however cannot be specified unfortunately.
Kind regards,
Marco
ksgenzer
That worked great--thank you
@Marco_Boeck
!
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups