Charts – Columns

Continuing my simple series of posts about Microsoft Dynamics CRM charts, I thought this time I would look at column charts. Hopefully you are already familiar with how to export the chart XML, edit and import back. If you are, everything in this post is actually pretty standard easy stuff.

An out of the box column charts looks something like the one below.

Exporting the chart XML for this column chart will give you the following, you can then edit it in notepad (or another editor). But what can we do? In this post I will examine a few of the simple parameters which can be changed on a column chart.

At first glance the XML may look complicated but if you look at little closer it is actually pretty straight forward.

<visualization>
<visualizationid>{D5666449-B4BC-4134-B5F8-BD67B130315B}</visualizationid>
<name>Case Mix by Incident Type</name>
<description>Case distribution by subject.</description>
<primaryentitytypecode>incident</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="incident">
<attribute alias="aggregate_column" name="incidentid" aggregate="count" />
<attribute groupby="true" alias="groupby_subject" name="subjectid" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category>
<measurecollection>
<measure alias="aggregate_column" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart>
<Series>
<Series IsValueShownAsLabel="True" Color="91, 151, 213" BackSecondaryColor="41, 88, 145" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40">
<SmartLabelStyle Enabled="True" />
<Points />
</Series>
</Series>
<ChartAreas>
<ChartArea BorderColor="White" BorderDashStyle="Solid">
<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181">
<MajorGrid LineColor="239, 242, 246" />
<MajorTickMark LineColor="165, 172, 181" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisY>
<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181">
<MajorGrid Enabled="False" />
<MajorTickMark Enabled="False" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisX>
</ChartArea>
</ChartAreas>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title>
</Titles>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>

DrawStyle

By adding DrawStyle to the custom properties you can control the look of the columns. See below how I have added DrawingStyle=Cylinder

<Series>
<Series IsValueShownAsLabel="True" Color="91, 151, 213" BackSecondaryColor="41, 88, 145" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Cylinder">
<SmartLabelStyle Enabled="True" />
<Points />
</Series>

The resulting chart then looks like this;

Other drawing styles exist …..

Emboss

LightToDark

Wedge

Note: Or you can use DrawingStyle=Default to show the default flat style.

3D Charts

It is possible to show column charts in by adding the command Area3DStyle Enable3D=”True”. As shown below.

</AxisX>
<Area3DStyle Enable3D="True" />
</ChartArea>
</ChartAreas>

3D and Cylinder

You can combine 3D and DrawingStlye Cylinder to create this effect.

3D and Emboss

3D and LightToDark

3D and Wedge

Colours

I am NOT saying the chart below looks good!!! I simply wanted to point out that after you’ve picked the style for your chart you can customize the colours for the columns, chart lines and titles.

You will see in the original XML that RGB codes are often used, for example Color=”91, 151, 213″. But you can replace this with Color=”Black”, you may find this produces XML code that is easier to read and saves you finding the RGB code for Red, Green, Blue etc.

One thought on “Charts – Columns

  1. Pingback: Charts – Collection | Microsoft Dynamics CRM and Unified Service Desk

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s