Archive for category ScaleBreak

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