Share

How to Change the Data Labels on a CRM 2011 Chart

I recently had a situation where I really wanted to change the data labels on a chart I built using the out of the box charting tool in 2011. Here’s the before screenshot (redacted):

 

image

The values are in the billions, typical of most high-end asset management firms.  I merely wanted to have the labels display as billions, which would be an easy task in SSRS.  However, this is a 2011 chart and I really didn’t want to reinvent the pie chart here in SSRS.  Luckily, there was no need.  Please see my post titled “(Really) Custom Charts in 2011” for some background as well as my new favorite blog by Sonal Sawhney of the Microsoft Dynamics CRM Team.  The steps in a nutshell are:

1. Export the chart.

2. Edit the XML.

3. Import the chart.

Obviously, the key here is how, in particular, should the XML be edited.  After some research, talking with our crack Development team, and downloading the Microsoft Chart Controls for .NET Framework Documentation,  I arrived at my answer which is the highlighted snippet below:

 

image

 

While figuring out that it was the LabelFormat attribute that had to be within the CustomProperties section, I did go into SSRS to grab all those zeroes, commas, and dollar signs you see after the label format by opening an existing report which did the same thing and viewing the XML code in there.  (See View –> Code in SSRS).

The end result was this (again redacted):

image

 

I expect I’ll use this again and again.  The beauty of this, and other examples in the blogs mentioned above, is that Dynamics does the heavy lifting for you, while you can refine it in a variety of ways.