Archive for category Percentage
The 100% stacked bar chart is great to display the relative amounts within a series.
However, for some reason the 100% stacked bar chart comes without labels to indicate what the percentage is for each group. You can eyeball it, but that’s not very accurate.
It is a little tricky to get to the accurate result, so I will go through the process of getting there.
The obvious thing to try first, is to export the chart xml and add IsValueShownAsLabel=”True” to the series.
This gives us the sum of each individual phase. This could be useful in its own right, but I really want the percentage on the label.
The next obvious thing to try, is to put in Label=”#PERCENT” and set IsValueShownAsLabel=”False”. Why not? It works great for pie charts.
Now we get some great looking percentages, but the values add up to 100 on the second series. Not across like we would expect.
The magic combo to add to the series xml for percentage labels on a 100% stacked bar chart in MS Dynamics CRM is:
IsValueShownAsLabel=”True” LabelFormat=”#.00′ %'”
Finally we have proper percentages across on the bar chart as we would expect.
A couple of other optimizations for a percentage bar chart.
LabelFormat=”#.00 ‘%'” in the series to show the percentage sign and always have 2 decimals.
Format=”0’%'” on the Y-axis to remove decimals and add percentage sign.
More on where and how to add Format and LabelFormat in MS Dynamics CRM charts here.
Thank you for reading. Please sign up for the newsletter to stay up to date on new blog posts and follow me on Twitter Follow @crmchartguy