CRM 2011 Charts come with a lot of information around the chart graphic itself. If the Axis Titles or Legends or maybe even the labels are redundant, it can make sense to remove them. This will make the chart graphic itself bigger, and for charts on subgrids, you can utilize the scarce space much better.
First let’s have a quick look at what is what:
- Highlighted in yellow: The chart Legend
- Underlined in Red: The Axis Titles
- Underlined in blue: The Axis Labels
Now, I’m not suggesting that removing the axis title, legend and axis labels all on one CRM chart is a good idea. It certainly is not, but it works for demonstration purposes.
Remove the Legend in CRM Charts
Export and open up your chart xml. In this example I use the Cases By Priority (Per Day) case chart that comes out of the box with Microsoft Dynamics CRM 2011.
On this type of chart the Legend is determined by the Series of the data. That means we have to toggle the visibility in the Series section with a Series property. Looking for a fitting Legend property won’t do you any good. Exception mentioned in the notes at the bottom of this post.
To remove the Legend I add the property IsVisibleInLegend=”false” to the series.
Let’s import the chart xml and have a look.
Remove the Axis Titles in CRM Charts
The tricky part here is, that to my knowledge, there is no property that will allow us remove the Axis Title similarly to what we did with the Legend. However, that does not mean we can’t use other Axis Properties to tamper with it, and make it look like we’ve removed it.
Here’s how I change the chart xml.
I added the Title property to each Axis. That way I control what the title is. I went with something really short in this case, “y” and “x”.
Then I changed the color of the title with TitleForeColor=”Transparent”.
Finally I reduced the font size to the lowest possible amount that I know charts in CRM 2011 will accept, which is 3 pixels. I do this because we want the now transparent text to take up less space. That is also why I went with the short names.
Let’s import and have one more look at the chart.
Remove the Axis Labels in CRM Charts
For fun, let’s just use the same trick on the Axis Labels and remove them too.
LabelStyle font and color I’ve changed similarly, to what I did with the Axis Title, 3px and transparent.
One last look and we can now say for sure it doesn’t make any sense to continue.
But if you really want to, you can find the instructions on completely disabling the axis in this post.
A couple of notes:
Some charts have <Legends> tags towards the bottom of the chart xml. If these were generated by CRM 2011, then you should be able to remove the legend, simply by removing that entire section.
Also, instead of naming the axes “y” and “x”, I could have given them longer and more descriptive names. Those names would then show up, if the User hovers the mouse over the axis. The same thing can be achieved with the ToolTip property. Either might be a better approach than the shorter names as the lenght of the title seem to have very limited or no influence on the utilization of space around the chart graphic. However, the font size does have an influence, so keep it small if you are trying to utilize the space as best as possible.
Thanks for reading. Please follow me on Twitter to get notified on new posts exclusively about CRM Charts for MS CRM 2011.