Dynamics CRM in the Field

Information from the Microsoft Dynamics CRM PFE team working in the field

Dynamics CRM Multi-Series Bar Charting – Returns Secondary Y-Axis

Dynamics CRM Multi-Series Bar Charting – Returns Secondary Y-Axis

  • Comments 1

I was recently assisting a customer with some custom charting and dashboards in Microsoft Dynamics CRM 2011. One of their goals was to create a bar chart that allowed them to compare three currency fields by owner for the account entity. One of the features of creating multi-series charts in Microsoft Dynamics CRM is the ability to create charts with a secondary y-axis which allows  each series to have their own measurement scale.

In my customers scenario, because they had three series in their chart rather than two, this secondary axis actually caused an issue where the bars in the chart were appearing incorrectly.

  1. Note that there are two competing y-axis acting as different measurement scales for the different series
  2. The sum of the data being returned, though correct, displays incorrectly in the graph ($35,000 has the highest bar while both $40,000 and $50,000 appear shorter)

111111

In digging in deeper we noticed that the chart was returning a left y-axis and a secondary right y-axis which is deemed “secondary” but added by default to the second series. The 1st series uses the left y-axis and the 2nd series uses the right y-axis and the in their case the 3rd series goes back to the first, causing the appearance of the chart to be inaccurate.

ASP.NET charting allows for a Primary and Secondary X and Y axis, and because we had 3 series this was causing issues with only being allowed 2 y-axis.

There was no way to actually control or edit this from the application, so to edit this chart I exported the XML. You can do this by selecting the “More Actions” menu from the chart area within any entities customizations area and selecting to “Export Chart.”

3333

Upon opening the XML in visual studio I noticed that there that the second series node had the following attached to the end: YAxisType="Secondary"></Series>
    

 1: <Series>
 2:    <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
 3:    <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" YAxisType="Secondary"></Series>
 4:    <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
 5:  </Series>
 
I went ahead and removed that from that node (YAxisType="Secondary") and saved a copy of the new xml.  I went back into the charting area for the account entity 
and through the same “More Actions” menu chose to import the chart.

After import the chart appears as desired, with no secondary y-axis and the chart data appearing correctly!

222222

If you are interested, our PFE team is ready to help you with this, we can assist with query examples and various other engagements to help you improve your CRM reports and performance. In addition, we have many other services we offer such as reporting workshops, developer training, admin workshops, and code reviews.  If you would like to have another Microsoft PFE or I visit your company and assist with the ideas presented on our blog, contact your Microsoft Premier Technical Account Manager (TAM) for booking information.  For more information about becoming a Microsoft Premier Customer email PremSale@microsoft.com.

Thanks!

Sarah Champ

 

  • Thank you very much for this simple walkthrough. The secondary axis was giving me a bit of a headache.

Page 1 of 1 (1 items)
Leave a Comment
  • Please add 7 and 4 and type the answer here:
  • Post