34
MS CRM 2011 CHART EDITING COMMON CHART XML EDITING James O'Connor 7/12/2012

MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

  • Upload
    vobao

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

MS CRM 2011 CHART EDITING

COMMON CHART XML EDITING

James O'Connor7/12/2012

Page 2: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

CONTENTSFORMATING AXIS LABELS............................................................................................................................2

REMOVING DECIMALS AND OTHER LABEL FORMATS..................................................................................3

SCALE BREAK ON Y AXIS (for large difference in the values)........................................................................4

SERIES AXIS X, Y LABEL CHANGES................................................................................................................5

LEGEND TEXT MODIFICATION.....................................................................................................................5

SERIES LABEL CHANGES...............................................................................................................................6

BAR & COLUMN CHARTS.............................................................................................................................7

EMBOSS.......................................................................................................................................................8

LIGHT TO DARK............................................................................................................................................9

WEDGE......................................................................................................................................................10

3D..............................................................................................................................................................11

STARTING WITH STACKED.........................................................................................................................13

GO WITH 3D CYLINDER..........................................................................................................................13

PIE CHART – 3D..........................................................................................................................................14

PIE CHART – CONCAVE..............................................................................................................................15

PIE CHART – SOFT EDGE............................................................................................................................16

DOUGHNUT CHART...................................................................................................................................17

DOUGHNUT CHART – 3D...........................................................................................................................18

DOUGHNUT CHART – CONCAVE................................................................................................................19

DOUGHNUT CHART – SOFT EDGE..............................................................................................................20

FUNNEL CHARTS SQUARE BASE.................................................................................................................21

FUNNEL CHARTS WITH A NECK..................................................................................................................22

FUNNEL CHARTS YIsWIDTH.......................................................................................................................23

3D CHART..................................................................................................................................................24

STACKED CHART / COMPARISON CHART...................................................................................................25

MULTI SERIES CHART.................................................................................................................................26

LABEL CHANGES........................................................................................................................................27

CRM 2011 CHART ENHANCEMENTS..........................................................................................................28

Page 3: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

FORMATING AXIS LABELS

Here is a chart with no formatting on its axis labels:

In the following example, we are assigning a custom format string to the format the Y-axis labels, which can be done either in the designer or with code.[C#]Chart1.ChartAreas[0].AxisY.LabelStyle.Format = "$0,,M";

[VB.NET]Chart1.ChartAreas(0).AxisY.LabelStyle.Format = "$0,,M"

Page 4: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

REMOVING DECIMALS AND OTHER LABEL FORMATS

By adding the following label property you can remove the decimals from the Chart.

LabelFormat=”#,0;(#,0)

If you wish to add a $ value to the LabelFormat you would the modify the values to the

following:

LabelFormat=”‘$’#,0;(#,0)

Alternatively you can modify the Labelformat to limited the number of decimals. For

example if you choose LabelFormat=’F2′ you will only see two decimal places.

Here are a few more examples of the kinds of formats you can provide:

"$3 million" - "$0,, million" "$500 K" - "$0, K" "$1,000,000.00" - "C" "$1,000,000" - "C0" "Oct 12, 2006" - "MMM dd, yyy" "October 12, 2006 12:00 AM" - "f"

Page 5: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

SCALE BREAK ON Y AXIS (for large difference in the values)

Please note that there are few conditions where scale break is not supported. You can find the details documented here.

// Enable scale breaks. chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = true;

// Show scale break if more than 25% of the chart is empty space. chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25;

// Set the line width of the scale break. chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineWidth = 2;

// Set the color of the scale break. chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineColor = Color.Red;

// If all data points are significantly far from zero, the chart will calculate the scale minimum value. chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.StartFromZero = StartFromZero.Auto;

// Set the spacing gap between the lines of the scale break (as a percentage of the Y-axis). chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Spacing = 2;

Page 6: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

http://msdn.microsoft.com/en-us/library/dd455709.aspx

SERIES AXIS X, Y LABEL CHANGES

<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount" Title="Red">

<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount" Title="White">

<AxisY2 LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount" Title="Blue">

LEGEND TEXT MODIFICATION

<Series ChartType="Bar" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" LegendText="Total">

<Series ChartType="Bar" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" LegendText="Savings">

Page 7: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor
Page 8: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

SERIES LABEL CHANGES

 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”

Page 9: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

BAR & COLUMN CHARTS

CYLINDER

<Chart>

<Series>

<Series ChartType="Bar" IsValueShownAsLabel="True" Color="149, 189, 66" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Cylinder">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 10: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

EMBOSS

<Chart>

<Series>

<Series ChartType="Bar" IsValueShownAsLabel="True" Color="149, 189, 66" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Emboss">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 11: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

 LIGHT TO DARK

<Chart>

<Series>

<Series ChartType="Bar" IsValueShownAsLabel="True" Color="149, 189, 66" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=LightToDark">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 12: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

WEDGE

<Chart>

<Series>

<Series ChartType="Bar" IsValueShownAsLabel="True" Color="149, 189, 66" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Wedge">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 13: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

3D

<ChartAreas>

<ChartArea BorderColor="White" BorderDashStyle="Solid">

<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IsReversed="False"><MajorGrid LineColor="128, 128, 128" /><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" IsReversed="False"><MajorGrid Enabled="False" /><MajorTickMark Enabled="False" /><LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" /></AxisX><Area3DStyle Enable3D="True" LightStyle="Realistic" WallWidth="5" IsRightAngleAxes="true" />

</ChartArea>

</ChartAreas>

Page 14: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

NO VALUES SHOWN ON BARS

<Chart>

<Series>

<Series ChartType="Bar" IsValueShownAsLabel="False" Color="149, 189, 66" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 15: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

STARTING WITH STACKED

GO WITH 3D CYLINDER

<Series>

<Series ChartType="Column" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Cylinder"></Series>

</Series>

<ChartAreas>

-and-

</AxisX>

<Area3DStyle Enable3D="True" LightStyle="Realistic" WallWidth="5" IsRightAngleAxes="true" />

</ChartArea>

Page 16: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

PIE CHART – 3D

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="True" />

</ChartArea>

</ChartAreas>

Page 17: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

PIE CHART – CONCAVE

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside,PieDrawingStyle=Concave" ChartType="pie">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="False" />

</ChartArea>

</ChartAreas>

Page 18: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

PIE CHART – SOFT EDGE

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside,PieDrawingStyle=SoftEdge" ChartType="pie">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="False" />

</ChartArea>

</ChartAreas>

Page 19: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

DOUGHNUT CHART

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="Doughnut">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 20: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

DOUGHNUT CHART – 3D

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="Doughnut">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="true" />

</ChartArea>

</ChartAreas>

</ChartAreas>

Page 21: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

DOUGHNUT CHART – CONCAVE

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside,PieDrawingStyle=Concave" ChartType=" Doughnut">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="False" />

</ChartArea>

</ChartAreas>

Page 22: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

DOUGHNUT CHART – SOFT EDGE

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside,PieDrawingStyle=SoftEdge" ChartType=" Doughnut">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

<ChartAreas>

<ChartArea>

<Area3DStyle Enable3D="False" />

</ChartArea>

</ChartAreas>

Page 23: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

FUNNEL CHARTS SQUARE BASE 

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" ChartType="Funnel" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=0", Funnel3DDrawingStyle=SquareBase">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 24: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

FUNNEL CHARTS WITH A NECK

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" ChartType="Funnel" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=3, FunnelPointGap=1, FunnelNeckWidth=5">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 25: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

FUNNEL CHARTS YIsWIDTH

<Series>

<Series ShadowOffset="0" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" ChartType="Funnel" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=0, FunnelStyle=YIsWidth">

<SmartLabelStyle Enabled="True" />

</Series>

</Series>

Page 27: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

STACKED CHART / COMPARISON CHART

 

 Along with above changes in XML we need to add/update the XML to get this reflected. Update the chart type to Stacked Chart

 This way we can convert a simple column chart into a comparison chart

 

Page 28: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

MULTI SERIES CHARTWe can get multiple series of data inside of chart just by adding simple entries in xml. Here we go

 

Once we add the attributes to fetch collection we need to mention how it has to be measured in collections. For that

 

Finally we need to mention how we want to present the extra series under presentationdescription node

Page 30: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor

CRM 2011 CHART ENHANCEMENTS

CRM SDK - View Data with Visualizations (Charts)

http://msdn.microsoft.com/en-us/library/gg309647.aspx

Chart Types (Chart Controls) - MSDN http://msdn.microsoft.com/en-us/library/dd489233.aspx

Microsoft Chart Controls Add-on for Microsoft Visual Studiohttp://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23903

Microsoft Chart Controls for .NET Framework Documentationhttp://www.microsoft.com/downloads/details.aspx?FamilyID=EE8F6F35-B087-4324-9DBA-6DD5E844FD9F&amp;amp;displaylang=e&displaylang=en

http://msdn.microsoft.com/en-us/library/ee704599.aspx

Page 31: MS CRM 2011 CHART EDITING - Microsoft Dynamics CRM030bacf.netsolhost.com/.../2012/07/Chart-Editing.docx  · Web viewms crm 2011 chart editing. common chart xml editing. james o'connor