Hello readers, this post is in continuation of my ”Getting to Know Charts” blog series, where we discuss useful features of charts. In the introductory post of this series we learned how to create a 3D chart and a multi series chart. Let’s answer some questions that I raised in the previous post.
1. Using large differences in data ranges can make the chart looks ugly – do charts support a scale break?
Absolutely!! Let’s say you have a chart with a huge gap between the low and high data values .You would prefer showing the two distinct ranges on the chart. The chart looks like the one to the right.
To add scale break export the chart xml and add ScaleBreakStyle under AxisY node:
Import the modified xml and your chart now appears as:
Simple! Isn’t it?
Please note that there are few conditions where scale break is not supported. You can find the details documented here.
2. I want to customize the series name and legends to something more meaningful than Sum (Estimated Revenue)
The chart in Crm 2011 are based upon the attributes of the entity and hence they reflect the attribute’s name and aggregation (Sum, Avg) if any, in the series names. For e.g. Sum (Actual Revenue) or Count (Name) etc.
However you can customize the series names using the Option Sets (Pick list, Status, State attribute types) in CRM. Take the following example.
Series name “Won” in this Chart is actually derived from the “Opportunity Status”
To modify the series name add the Name attribute to the Series node in the exported xml of the chart. For e.g.:
This will display the Series name as Won:
<Series Name=”o:opportunity_statecode,1” Color=”149, 189, 66” IsValueShownAsLabel=”False” BackGradientStyle=’TopBottom” BackSecondaryColor=”112, 142, 50” Font=”{0}, 9.5px” LabelForeColor=”59, 59, 59“>
This will display the Series name as Lost:
<Series Name=”o:opportunity_statecode,2” Color=”255,124,31” IsValueShownAsLabel=”False” BackGradientStyle=’TopBottom” BackSecondaryColor=”235,98,0” Font=”{0}, 9.5px” LabelForeColor=”59, 59, 59“>
You can instruct the chart to pick the series name from the display names of some option set values using the following format:
Name = “o:optionsetLogicalName,optionSetValue”
You can use the existing option sets or create your own to reflect the series names. I hope you find this blog post helpful and informative. I have some more charting tips and tricks to share with you soon.
Cheers,