Update: 5/1/2017: Post updated to support all versions of Dynamics CRM from CRM 2011 to Dynamics 365.
Dynamics CRM (or Dynamics 365) Charts come with a lot of information around the chart graphic itself. Often the Axis Titles, Legends or maybe even the labels are redundant. If they are 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 Dynamics 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.
On this type of chart the legend visibility is determined by a property in the Series. That means we have to toggle the visibility of the legend items in the Series section, not in the Legend section. 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 Dynamics 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 Dynamics CRM/365 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 it and have one more look at the chart.
Remove the Axis Labels in Dynamics CRM Charts
For fun, let’s just use the same trick on the Axis Labels and remove them too.
In the LabelStyle font and color I’ve made similar changes, to what I did with the Axis Title. Lowered size to 3px and set the color to 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 Dynamics CRM/365, 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 Dynamics CRM Charts including Dynamics 365.