The other day I came across a problem where the out of the box charting tool was just not quite there for me. So naturally I turned to my other favorite blog, that of the Microsoft CRM Team, for some help. The problem was where I was trying to create a multi-series chart. I came across two blogs on
The basic steps in creating a custom chart are as follows:
1. Export the chart.
2. Edit the XML.
3. Import the chart.
Now, if you’re like me maybe you would look at the XML of an exported chart and feel a bit overwhelmed. The aforementioned blog is a nice starter to navigating within the XML, and I also exported a couple of charts in addition to the one I was looking to change for comparison. After seeing a pattern in each of the samples, it all came down to one or two snippets of code. (This is always a good thing to do when trying to figure out something maybe not so self-evident: look at the existing components in the system. Odds are that a lot of the things you are trying to do are already baked into the system. I found this be very true in working with reports.) That piece of advice is for those of us not familiar with ASP.NET charting controls. For those of you who are, consider this gem:
“You might have caught the hint that CRM charts have all the capabilities that asp .net chart controls possess.”
This was perhaps the most eye-opening comment in general. The more one realizes all of the things you can do with chart controls and how to do it, the more you’ll get out of these. And remember, I was able to create a custom chart quickly by following along with the blog and looking at other charts in the CRM, some canned and some created as part of the implementation. So while its great if you “know” ASP.NET chart controls, it is not a necessity to create some smart looking charts using these steps.
Since this initial chart, I’ve done some experimenting and created charts with different series types and even one with a secondary y-axis. See example below, with some information redacted, of a chart I was toying around with:
Hats off to the Microsoft CRM Team again!
Post by: James Diamond,