Adding Percent Sign (%) to Microsoft Dynamics CRM Charts

Adding Percent Sign (%) to Microsoft Dynamics CRM Charts

It is no secret that the charts and dashboard capabilities included in Microsoft Dynamics CRM 2011 are a great tool for reporting and ultimately help increase User Adoption, but even these great tools sometimes lack flexibility. For example, I often find myself working with a customer that wants to see a percentage on a chart instead of a number.

Here is the example:

The chart on the right shows me how many active cases I have segmented by Origin. By looking at the chart, I see that "Phone" is the biggest entry point for these cases but in my mind is hard to figure out percentage wise how much is 10 cases in the system versus the other 18. Since the numbers are low I can quickly do some approximate math in my head and come up with about 40%. But what if this chart was more complex, for example if we had 8 different sources and the numbers were on the hundreds or thousands; it would be tough.

Luckily for us, formatting this chart so it displays percentage instead of count is very simple. If you ever find yourself needing to format one of your charts just follow these five simple steps:

  1. First, Navigate to the chart you need to format and export it via the Chart Tab:

  2. Save the chart (.xml file) and open it with a text editor, in this case I'm using Notepad++. You will focus on the "Series" section of the chart:

    Code:

    <Series>

    <Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="pie">

    <SmartLabelStyle Enabled="True" />

    </Series>

    </Series>

  3. Switch the "IsValueShownAsLabel" to "FALSE" and Add "Label" and "LabelFormat" values to the Series details as shown below:

    Code:

    <Series>

    <Series ShadowOffset="0" IsValueShownAsLabel="False" Label="#PERCENT" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="pie" LabelFormat="#0.##%">

    <SmartLabelStyle Enabled="True" />

    </Series>

    </Series>

  4. Save your XML and navigate back to Microsoft Dynamics CRM and the place where you exported the chart. Import the saved XML:

  5. Enjoy the new chart!

If you have any questions regarding these steps, or how to upgrade, let us know here.


Microsoft Dynamics CRM Blog