Annotations in MS CRM Charts

It might be a well-hidden secret, but it is actually fairly easy to add extra comments or annotations to your charts in MS Dynamics CRM.

This could be for extra descriptions or guidance on how to interpret the chart.

Here is an example of a chart with an annotation added.

Annotation

This example is simple, but the annotation can be customized with different fonts, sizes, positioning, have a tool-tip, etc.

Before moving on, I would highlight that a well-designed chart should not need any additional explanation ever. However, no rule without exceptions, so if you do need to add annotations to your chart, here’s how it is done.

Take any chart you want to add the annotation to, export the chart xml and add this piece of code towards the bottom between the </Legends> and </Chart> tags.
If you copy the code below, only include <Annotations> through </Annotations>.

      </Legends>
	  <Annotations>
		<TextAnnotation X="50" Y="0" Text="Annotation - CRM Chart Guy" TextStyle="Default" Font="Verdana, 15px" ForeColor="59, 59, 59" ToolTip="ToolTip for the Annotation"/>
	  </Annotations>
    </Chart>

The coordinates, X=”50″ and Y=”0″, sets the position of the annotation. They are percentages with 0,0 in the upper left corner and 100,100 in the bottom right. 50,50 would be right in the middle. In this sample I used x 50 and Y 0 to put the chart annotation centered on top.

Text is what you want the annotation to say.
TextStyle I have set to Default, but the options are Default, Embed, Emboss, Frame and Shadow.
Font=”Verdana, 15px” is the font type and size. Here is a good list of fonts if you want to switch it.
ForeColor sets the color of the font. See my previous post on colors in CRM charts for details.
Finally, you can add a tool-tip if you want to elaborate further.

You can find all the details on annotations on https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.textannotation%28v=vs.110%29.aspx

While annotations can be helpful in some cases, they unfortunately do not support keywords or any other dynamically inserted data. This means, for example, that you cannot add a total, average, or other keywords in the annotation.

Thank you for reading. Please sign up for the newsletter to stay up to date on new blog posts and follow me on Twitter

4 thoughts on “Annotations in MS CRM Charts

  1. Hi,
    I need to build a chart showing a list of top 10 open opportunities by estimated revenue. Simple enough except the fact that I need to also show the ‘sum total’ of all the est. revenue as well. how can I do that? Is it even possible OOB or using any of the above export XML hack?

    • Not 100% sure if that is possible. However. first I would make sure to not use the Top 10 feature in the chart editor. Rather sort the chart and then adjust the axis (in the xml) to only show the 10 highest values. The difference is that the chart editor’s “top feature” excludes the rest of the opportunities from the fetch. You will need them all in order to calculate a total, which you will like have to do in a different series. Hope I am giving you enough to move forward. As I am writing through this though, I would be surprised if it wasn’t possible to do it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s