Archive for March, 2013

Everything ScaleBreak in MS CRM 2011 Charts

Adding a ScaleBreak to charts in CRM can be useful when you have data that varies a lot. For example one column with a very high value, can dwarf the rest so it is impossible to see the details in them.

Luckily, MS CRM 2011 allow us to add a ScaleBreakStyle to our chart xml. This post is technically a follow up to my Axis Modifications – Part 1 I did some time ago. That was a rather long post. I’ll break my Axis series in to smaller pieces from now on. Otherwise, I’ll never get around to it.

ScaleBreakStyle Added to CRM Chart xml in MS CRM 2011

CRM Chart with ScaleBreak added

The ScaleBreakStyle has list of properties, which allow us to modify the settings of the ScaleBreak in case the default settings doesn’t meet our needs.

The ScaleBreakStyle Properties are:

  • Enabled
  • BreakLineStyle
  • CollapsibleSpaceThreshold
  • LineColor
  • LineDashStyle
  • LineWidth
  • MaxNumberOfBreaks
  • Spacing
  • StartFromZero

Add these as necessary to the Y Axis properties in the chart xml. Here they are, highlighted in the xml, all of them listed with their default value.

<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
   <MajorGrid LineColor="239, 242, 246" />
   <MajorTickMark LineColor="165, 172, 181" />
   <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
   <ScaleBreakStyle Enabled="True"
     BreakLineStyle="Ragged"
     CollapsibleSpaceThreshold="25"
     LineColor="59,59,59"
     LineDashStyle="Solid"
     LineWidth="1"
     MaxNumberOfBreaks="2"
     Spacing="1.5"
     StartFromZero="Auto" />
</AxisY>

Normally MS CRM 2011 puts all the properties on one line. For readability, I listed them here below each other. Both works just fine in the xml, so it’s just a matter of preference.

Let’s go through the ScaleBreakStyle properties one by one. Note that if one of the properties is left out, the default value will be used.

Enabled

Values: “True”, “False”

Naturally, this should be set to True. The only reason I would set it to “False” is if I’m testing a chart and need to temporarily turn of the ScaleBreak, but without removing the code.

BreakLineStyle

Values:

  • Straight
    BreakLineStyle Straight in MS CRM 2011 CRM Chart
  • Wave
    ScaleBreak BreakLineStyle Wave in MS CRM 2011 CRM Chart
  • Ragged (default)
    ScaleBreak BreakLineStyle Ragged (default) in MS CRM 2011 CRM Chart
  • None
    ScaleBreak BreakLineStyle None in MS CRM 2011 CRM Chart

The official description for BreakLineStyle=”None” is that the scale break is not displayed. As you can see in the picture, it just means there’s no scale break line. The scale break is still there.

CollapsibleSpaceThreshold

  • Default value = 25
  • Min value = 10
  • Max value = 90

The CollapsibleSpaceThreshold property is a percentage of the Y axis. The default value for 25 means that the data in your series must have a difference of at least 25% for the ScaleBreak to appear.

In other words, you can toggle the sensitivity the scale break using a number between 10 and 90. The lower the value, the more scale breaks might appear. Only an evaluation of the data presented can tell you what the right amount should be. However, 25 is the default for a reason and it should work for most cases.

LineColor

Default value: “59, 59, 59”

You can add any color here. See this post for more information on colors.

LineDashStyle

  • NotSet (default)
  • Dash
    XLineDashStyleDash
  • DashDot
    XLineDashStyleDashDot
  • DashDotDot
    XLineDashStyleDashDotDot
  • Dot
    XLineDashStyleDot
  • Solid (default)
    XLineDashStyleSolid

NotSet and Solid will display a solid line for the scale break, which is also the default.

LineWidth

  • Default value =  1
  • Min value = 1
  • Max value = 10

The thickness of the line measured in pixels

MaxNumberOfBreaks

  • Default value = 2
  • Min value = 0
  • Max value = 5

How many scale breaks in your chart will you allow? The chart engine supports up to 5 scale breaks. Not sure why zero is an option here??
Leave it out and it will allow up to 2 scale breaks.

MaxNumberOfBreaks along with CollapsibleSpaceThreshold are really the two settings that define how the scale break is calculated. The rest is mostly regarding the visual presentation of the break.

Spacing

  • Default value = 1.5
  • Min value = 0
  • Max value = 10
ScaleBreak Spacing Default value in MS CRM 2011 CRM Chart

Spacing=”1.5″ Default value

ScaleBreak Spacing 10 max value in MS CRM 2011 CRM Chart

Spacing=”10″ max value

Spacing, like CollapsibleThreshold, is measured as a percentage of the Y axis, although your range of values is a lot smaller. The default is 1.5, so it obviously allow for decimals. Up to at least 3 if you want to very specific on your spacing. Note that Spacing creates an actual gap in the Y Axis.

StartFromZero

Values:

  • Auto (default)
  • Yes
  • No

StartFromZero defines if the chart should start looking for possible scale breaks from either zero, or from the lowest value in your data set. Auto seems to do a good job, but if there are situations where you want to force it one way or the other, it is possible.

Some Observations

ScaleBreakStyle seems to work on most relevant charts incl. Column, Bar, Area, Spline, Kagi, Point, Line, FastPoint & FastLine. It also works on Multi Series Charts. These are just examples.

ScaleBreak on chart type Area in MS CRM 2011 CRM Chart ScaleBreak on chart type Bar in MS CRM 2011 CRM Chart ScaleBreak on chart type Kagi in MS CRM 2011 CRM Chart ScaleBreak on chart type Point in MS CRM 2011 CRM Chart ScaleBreak on chart type Spline in MS CRM 2011 CRM ChartScaleBreak on Multi Series Column Chart in MS CRM 2011 Chart

The ScaleBreak does NOT work on Stacked Charts or Stacked 100 Charts. You can add the ScaleBreak, but it won’t make display in the chart.

Reduce the ScaleBreak to a line

Setting Spacing=”0″ reduces the Scale Break to a line. Then use LineColor and LineWidth to define the ScaleBreak. Do note that Spacing actually creates a gap in your Y Axis while the LineWidth just paints on top of the Y Axis.

ScaleBreak Reduced to Line with Spacing 0 in CRM Chart for MS CRM 2011

Make the ScaleBreak invisible

Use with CAUTION. Could be very misleading

  • Spacing=”0″
  • BreakLineStyle=”None”

ScaleBreak made invisible with Spacing 0 and BreakLineStyle None

Notice the jump in the axis values. Aside from that, there’s no indication that a ScaleBreak was added.

3D?

Nope – you lose the ScaleBreak feature if you add <Area3DStyle Enable3D=”true”/>

Can edit in the Chart Designer and keep the ScaleBreak

If you have imported your ScaleBreak chart as a personal chart, you can open it in the editor and make changes to the series etc. without losing the ScaleBreak. Sometimes xml customizations will disappear when using the Chart Designer, but in the case of ScaleBreaks you are good to go.

ScaleBreak in MS CRM 2011 Chart Designer

You can find the official reference on the AxisScaleBreakStyle here.

Hope you enjoyed this post.

If you did, please follow me on Twitter for CRM Chart updates

Now, I gave the post the arrogant title of “Everything ScaleBreak”. If I missed something, please let me know in the comments and I’ll update the post 🙂

, , , , , ,

5 Comments

Aggregate Total on top of Stacked Column Charts or Bar Charts in MS CRM 2011

Adding an aggregated total to the top of a stacked column chart sounds simple enough. It’s a couple of clicks in Excel. In MS CRM 2011 however, it is a different story. You would have to add an additional series to the chart, which then calculates and displays the total. But Stacked Column charts in MS CRM 2011 do not support multiple series.

CRM 2011 Stacked Column Chart with aggregate total on top

But that does not mean it is not possible. This CRM chart show us the aggregated total value of each of our pipelines, stacked by the pipeline phases, for each of the types of purchase processes.

So how did I create this chart? First, I need a chart with a series for each of the 4 pipeline stages, and one for the total. Then I display the series in the chart so they look like a standard stacked column chart. The total on top is a point chart type. The drawback here, is of course that all the possible series needs to be known so we can include them in the chart. In this case, all the series are each phase in the pipeline.

Since the user interface in MS CRM 2011 for creating charts does not support multiple series for stacked column charts, we need to create something else as our chart XML base and work off that.

I will use the UI to create a normal column chart and add all the series I need.

In this case a column chart with 5 series.

Chart Designer with all the series and category - CRM 2011 CRM Chart

1 for each of the 4 stages in the pipeline (Develop, Qualify, Propose, Close) plus 1 extra series for the total.

I want to see how my pipelines looks between the different types of Purchases Processes, so I’ll pick “Purchase Process” as the category so I get that on the X axis.

All the series I have added as a standard column chart.

Now I’ll export the chart xml and get to work. (Full chart XML samples are available at the bottom of this post)

CRM 2011 might add some references to a secondary Y axis in your XML. If that is the case, remove these first.

Rename the series in the Chart XML

I’ll start out by renaming all the aliases to something more sensible and easier to work with.

Original XML

Original Chart XML datadescription with aliases highlighted

Chart XML with renamed aliases

Chart XML with new aliases

Now it’s much easier for me to see which alias represents what data. I have “Purchase Process” as the category, the name for each pipeline phase, and the aggregated total at the end.

Change the Series Chart Types

Next I’ll change the first 4 series for the pipeline phases from ChartType=”Column” to ChartType=”StackedColumn”.

The last series for the aggregated total will need the following changes;

  • ChartType=”Point”
  • IsVisibleInLegend=”False” – don’t need to see “Total” in the legend
  • IsValueShownAsLabel=”True” – YES, this is the whole point of this chart
  • LabelFormat=”#,#,#” – no need to see decimals on the total
  • MarkerColor & MarkerBorderColor=”Transparent” – we just want the total amount – no need to see a marker also
  • The font I increased to 14px so it stands out more

Changing the series charttypes in the xml

Let’s do a quick import of the chart xml just to check what it now looks like in CRM.

Chart after intial modifications - no filters, all totals

We can see the total amount in the larger font, but the different pipeline phases are also showing the aggregate amount.

Let’s add a filter to each of the series in the fetchcollection, so they only show the correct amount for each phase.

Filter the series for the Pipeline Phases

Here’s the original fetchcollection.

Chart XML Fetchcollection with new aliases

I’ll add a filter to each of the series by creating a self-referential <link-entity>. This will allow me to make sure each series only sum up the value of the Opportunities, specific to its phase.  The easiest way to get the filter properties is by creating them in Advanced Find and export the FetchXML.

Each attribute will get a <link-entity> and <filter> added as follows.


<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
  <attribute alias="qualify" name="estimatedvalue" aggregate="sum" />
    <filter>
      <condition attribute="stepname" operator="eq" value="1-Qualify" />
    </filter>
</link-entity>

Here’s a part of the fetchcollection with filters added for each attribute for the pipeline phases. The last attribute I’ll leave without a filter as we do want the total on that one.

Chart XML Fetchcollection with Filters for each phase matcing the alias

Time to import the XML and have a look.

Chart with Total on Top - Filtered, but with Orignial colors and settings

Chart is now filtered and stacked properly for each series and there’s an aggregated total on top.

Adjust Chart Axis, Legend and Colors

It works, but we can make the chart look a lot easier to read and understand.

I’ll make the following changes:

  • IsValueShownAsLabel=”false” on all series except the total.
  • Add LegendText to all the series except the total
  • Add Color to each series – I’m going with increasingly darker shades of blue in this case
  • Add Format=”$#,#,k” to the LabelStyle for a shorter label on the Y axis

Last, I’ll reverse the series in the legend, because MS CRM 2011 automatically reverses it on stackedcolumn charts. In other words, I reverse the reversed order so it reads 1-2-3-4 instead of 4-3-2-1.

Cleaning up the Chart by adding colors ot the series etc.

One final import of the CRM chart XML and here’s the result.

CRM 2011 Chart - Stacked Column with Aggregate Total on Top

A couple of notes:

  • Bonus: Even though no Opportunities are in phase “4-Close”  we still see it in the legend
  • Filtering in the XML can be tricky – it’s your job to make sure everything relevant get’s accounted for
  • This approach allow you to add colors directly in the Series, which can be a lot easier than using the PaletteCustomColors
  • The Series have to be listed in the exact same order in the presentationdescription as they do in the measurecollection
  • The User can still hover the mouse over the chart to get the exact value of each pipeline phase in the tooltip

How about an Aggregate Total on top of a Stacked Bar Chart?

The same approach can be used for bar charts. All the chart types need to be a Stacked Bar for the pipeline phases and then a regular Bar type for the total, which then have to be made transparent. (XML sample included at the bottom of post)

CRM Chart 2011 Stacked Bar with Aggregate Total on top

Hope you enjoyed this post.

If you did, please follow me on Twitter for CRM Chart updates

Chart XML Samples

These chart xml samples are for reference only and not intended for use in a live environment without thorough testing.

They were created on a Microsoft Dynamics CRM 2011 trial with only the sample data added. The only addition I made to the sample data, was adding values to the Purchase Process field on the Opportunities.

Stacked Column Chart with aggregated total

<visualization>
<visualizationid>{C618533F-3784-E211-8B16-78E3B5114607}</visualizationid>
<name>Aggregated Total on top of StackColumn chart</name>
<primaryentitytypecode>opportunity</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="opportunity">
<attribute groupby="true" alias="purchase_process" name="purchaseprocess" />
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="qualify" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="1-Qualify" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="develop" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="2-Develop" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="propose" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="3-Propose" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="close" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="4-Close" />
</filter>
</link-entity>
<attribute alias="aggregated_total" name="estimatedvalue" aggregate="sum" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category alias="purchase_process">
<measurecollection>
<measure alias="qualify" />
</measurecollection>
<measurecollection>
<measure alias="develop" />
</measurecollection>
<measurecollection>
<measure alias="propose" />
</measurecollection>
<measurecollection>
<measure alias="close" />
</measurecollection>
<measurecollection>
<measure alias="aggregated_total" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83">
<Series>
<Series ChartType="Stackedcolumn" LegendText="1-Qualify" Color="LightSteelBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedcolumn" LegendText="2-Develop" Color="CornflowerBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedcolumn" LegendText="3-Propose" Color="RoyalBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedcolumn" LegendText="4-Close" Color="DarkBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Point" IsVisibleInLegend="False" IsValueShownAsLabel="True" LabelFormat="$#,#,#" MarkerBorderColor="Transparent" MarkerColor="Transparent" Font="{0}, 14px" LabelForeColor="59, 59, 59"></Series>
</Series>
<ChartAreas>
<ChartArea BorderColor="White" BorderDashStyle="Solid">
<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorGrid LineColor="239, 242, 246" />
<MajorTickMark LineColor="165, 172, 181" />
<LabelStyle Font="{0}, 10.5px" Format="$#,#,k" ForeColor="59, 59, 59" />
</AxisY>
<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorTickMark LineColor="165, 172, 181" />
<MajorGrid LineColor="Transparent" />
<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>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" LegendItemOrder="ReversedSeriesOrder" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
</Legends>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>

Stacked Bar Chart with aggregated total

 <visualization>
<visualizationid>{C618533F-3784-E211-8B16-78E3B5114607}</visualizationid>
<name>Aggregated Total on top of Stackedbar Chart</name>
<primaryentitytypecode>opportunity</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="opportunity">
<attribute groupby="true" alias="purchase_process" name="purchaseprocess" />
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="qualify" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="1-Qualify" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="develop" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="2-Develop" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="propose" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="3-Propose" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="close" name="estimatedvalue" aggregate="sum" />
<filter>
<condition attribute="stepname" operator="eq" value="4-Close" />
</filter>
</link-entity>
<attribute alias="aggregated_total" name="estimatedvalue" aggregate="sum" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category alias="purchase_process">
<measurecollection>
<measure alias="qualify" />
</measurecollection>
<measurecollection>
<measure alias="develop" />
</measurecollection>
<measurecollection>
<measure alias="propose" />
</measurecollection>
<measurecollection>
<measure alias="close" />
</measurecollection>
<measurecollection>
<measure alias="aggregated_total" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83">
<Series>
<Series ChartType="Stackedbar" LegendText="1-Qualify" Color="LightSteelBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedbar" LegendText="2-Develop" Color="CornflowerBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedbar" LegendText="3-Propose" Color="RoyalBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Stackedbar" LegendText="4-Close" Color="DarkBlue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series ChartType="Bar" IsVisibleInLegend="False" IsValueShownAsLabel="True" LabelFormat="$#,#,#" Color="Transparent" Font="{0}, 14px" LabelForeColor="59, 59, 59"></Series>
</Series>
<ChartAreas>
<ChartArea BorderColor="White" BorderDashStyle="Solid">
<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorGrid LineColor="239, 242, 246" />
<MajorTickMark LineColor="165, 172, 181" />
<LabelStyle Font="{0}, 10.5px" Format="$#,#,k" ForeColor="59, 59, 59" />
</AxisY>
<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorTickMark LineColor="165, 172, 181" />
<MajorGrid LineColor="Transparent" />
<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>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" LegendItemOrder="ReversedSeriesOrder" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
</Legends>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>

, , , , , , ,

61 Comments

Removing Axis Titles, Legend and Axis Labels in CRM Charts for MS CRM 2011

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:

Original chart with indicators

  • 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.

2 - No Legend IsVisibleInLegend False

To remove the Legend I add the property IsVisibleInLegend=”false” to the series.

Let’s import the chart xml and have a look.

No Legend and the chart is now taking up more of the space available.

No Legend and the chart is now taking up more of the available space.

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.

3 - No Titles they are transparent

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.

Axis Titles in the CRM chart has now been removed, although "hidden" might be a more accurate term.

Axis Titles in the CRM chart has now been removed, although “hidden” might be a more accurate term.

Remove the Axis Labels in CRM Charts

For fun, let’s just use the same trick on the Axis Labels and remove them too.

Transparent axis labels in the chart xml

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.

No Legend, no axis titles , no axis labels.

No Legend, no axis titles , no axis labels.

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.

, , , , , , , , , ,

8 Comments