This documentation is archived and is not being maintained.

Visualization (Chart) Samples

Forefront
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

The following samples show the data description XML and presentation XML for different chart types. These charts are available out-of-box in Microsoft Dynamics CRM Online. The data description XML and presentation XML values correspond to the following attributes:

Bar Chart (Top 10 Customers)

The following is a bar chart that shows the sum of estimated opportunity revenue by customer name.

Bar chart, top 10 customers

Data XML

The following is the contents of the Data XML string for this chart.

<datadefinition>
   <fetchcollection>
      <fetch mapping='logical' count='10' aggregate='true'>
         <entity name='opportunity'>
            <attribute name='estimatedvalue_base' aggregate='sum' alias='sum_estimatedvalue_base'/>
            <attribute name='customerid' groupby='true' alias='customerid'/>
            <order alias='sum_estimatedvalue_base' descending="true" />
         </entity>
      </fetch>
   </fetchcollection>
   <categorycollection>
      <category>
         <measurecollection>
            <measure alias='sum_estimatedvalue_base'/>
         </measurecollection>
      </category>
   </categorycollection>
</datadefinition>

Presentation XML

The following is the contents of the Presentation XML string for this chart.

<Chart Palette="BrightPastel">
   <Series>
      <Series _Template_="All" Color="112, 162, 213" BorderColor="164, 164, 164" BorderDashStyle="Solid" BorderWidth="1" ShadowColor="128, 128, 128, 128" ShadowOffset="1" IsValueShownAsLabel="true" Font="Tahoma, 6.75pt, GdiCharSet=0" BackSecondaryColor="0, 102, 153" LabelForeColor="100, 100, 100" ChartType="Bar">
         <SmartLabelStyle Enabled="True" />
         <Points />
      </Series>
   </Series>
   <ChartAreas>
      <ChartArea _Template_="All" BackColor="White" BorderColor="26, 59, 105" BorderWidth="0" BorderDashStyle="Solid">
         <AxisY LineColor="204, 204, 204" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" />
            <MajorGrid Enabled="false" />
            <LabelStyle Font="Tahoma, 6.75pt, GdiCharSet=0" ForeColor="100, 100, 100" />
         </AxisY>
         <AxisX LineColor="204, 204, 204" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" />
            <MajorGrid Enabled="false" />
            <LabelStyle Font="Tahoma, 6.75pt, GdiCharSet=0" ForeColor="100, 100, 100" />
         </AxisX>
         <Area3DStyle LightStyle="Realistic" IsClustered="True" />
      </ChartArea>
   </ChartAreas>
   <Titles>
      <Title _Template_="All" Font="Tahoma, 9pt, style=Bold, GdiCharSet=0" ForeColor="100, 100, 100"></Title>
   </Titles>
   <BorderSkin PageColor="Control" BackColor="CornflowerBlue" BackSecondaryColor="CornflowerBlue" />
</Chart>

Multi-Series Column Chart (Estimated vs. Actual Revenue (By Month))

The following is a multi-series column chart that shows how much revenue was actually closed versus how much was estimated per month.

Multi-series column chart example

Data XML

The following is the contents of the Data XML string for this chart.

<datadefinition>
   <fetchcollection>
      <fetch mapping="logical" aggregate="true">
         <entity name="opportunity">
            <attribute name="estimatedvalue_base" aggregate="sum" alias="estvalue_base" /> 
            <attribute name="actualvalue_base" aggregate="sum" alias="actvalue_base" /> 
            <attribute name="actualclosedate" groupby="true" alias="actclosedate" dategrouping="month" /> 
         </entity>
      </fetch>
   </fetchcollection>
   <categorycollection>
      <category>
         <measurecollection>
            <measure alias="estvalue_base" /> 
         </measurecollection>
         <measurecollection>
            <measure alias="actvalue_base" /> 
         </measurecollection>
      </category>
   </categorycollection>
</datadefinition>

Presentation XML

The following is the contents of the Presentation XML string for this chart.

<Chart Palette="BrightPastel">
   <Series>
      <Series _Template_="All" Color="112, 162, 213" BorderColor="164, 164, 164" BorderDashStyle="Solid" BorderWidth="1" ShadowColor="128, 128, 128, 128" ShadowOffset="1" IsValueShownAsLabel="true" Font="Tahoma, 6.75pt, GdiCharSet=0" BackGradientStyle="TopBottom" BackSecondaryColor="0, 102, 153" LabelForeColor="100, 100, 100" ChartType="Column">
         <SmartLabelStyle Enabled="True" /> 
         <Points /> 
      </Series>
      <Series _Template_="All" Color="204,0,0" BorderColor="204,0,0" BorderDashStyle="Solid" BorderWidth="1" ShadowColor="128, 128, 128, 128" ShadowOffset="1" IsValueShownAsLabel="true" Font="Tahoma, 6.75pt, GdiCharSet=0" BackSecondaryColor="0, 102, 153" LabelForeColor="100, 100, 100" ChartType="Column">
         <SmartLabelStyle Enabled="True" /> 
         <Points /> 
      </Series>
      </Series>
   <ChartAreas>
      <ChartArea _Template_="All" BackColor="White" BorderColor="26, 59, 105" BorderWidth="0" BorderDashStyle="Solid">
         <AxisY LineColor="204, 204, 204" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" /> 
            <MajorGrid Enabled="false" /> 
            <LabelStyle Font="Tahoma, 6.75pt, GdiCharSet=0" ForeColor="100, 100, 100" /> 
         </AxisY>
         <AxisX LineColor="204, 204, 204" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" /> 
            <MajorGrid Enabled="false" /> 
            <LabelStyle Font="Tahoma, 6.75pt, GdiCharSet=0" ForeColor="100, 100, 100" /> 
         </AxisX>
         <Area3DStyle LightStyle="Realistic" IsClustered="True" /> 
      </ChartArea>
   </ChartAreas>
   <Legends>
      <Legend _Template_="All" Alignment="Center" LegendStyle="Table" Docking="Bottom" IsEquallySpacedItems="True" BackColor="White" BorderColor="228, 228, 228" BorderWidth="0" Font="Tahoma, 8pt, GdiCharSet=0" ShadowColor="0, 0, 0, 0" ForeColor="100, 100, 100" /> 
   </Legends>
   <Titles>
      <Title _Template_="All" Font="Tahoma, 9pt, style=Bold, GdiCharSet=0" ForeColor="100, 100, 100" /> 
   </Titles>
   <BorderSkin PageColor="Control" BackColor="CornflowerBlue" BackSecondaryColor="CornflowerBlue" /> 
</Chart>

Sales Funnel Chart (Sales Pipeline)

The following is a funnel chart that shows your organization's anticipated potential sales by pipeline phase.

Sales funnel chart example

Data XML

The following is the contents of the Data XML string for this chart.

<datadefinition>
   <fetchcollection>
      <fetch mapping="logical" aggregate="true">
         <entity name="opportunity">
            <attribute groupby="true" alias="groupby_column" name="stepname" /> 
            <attribute alias="aggregate_column" name="estimatedvalue_base" aggregate="sum" /> 
         </entity>
      </fetch>
   </fetchcollection>
   <categorycollection>
      <category>
         <measurecollection>
            <measure alias="aggregate_column" /> 
         </measurecollection>
      </category>
   </categorycollection>
</datadefinition>

Presentation XML

The following is the contents of the Presentation XML string for this chart.

<Chart Palette="BrightPastel">
   <Series>
      <Series _Template_="All" ShadowOffset="2" BorderColor="64, 64, 64" BorderDashStyle="Solid" BorderWidth="1" IsValueShownAsLabel="true" Font="Tahoma, 6.75pt, GdiCharSet=0" LabelForeColor="100, 100, 100" CustomProperties="FunnelLabelStyle=Outside" ChartType="Funnel">
         <SmartLabelStyle Enabled="True" />
         <Points />
      </Series>
   </Series>
   <ChartAreas>
      <ChartArea _Template_="All" BackColor="Transparent" BorderColor="Transparent" BorderDashStyle="Solid">
         <Area3DStyle Enable3D="True" IsClustered="True" />
      </ChartArea>
   </ChartAreas>
   <Legends>
      <Legend _Template_="All" Alignment="Center" LegendStyle="Table" Docking="Bottom" IsEquallySpacedItems="True" BackColor="White" BorderColor="228, 228, 228" BorderWidth="0" Font="Tahoma, 8pt, GdiCharSet=0" ShadowColor="0, 0, 0, 0" ForeColor="100, 100, 100">
      </Legend>
   </Legends>
   <Titles>
      <Title _Template_="All" Font="Tahoma, 9pt, style=Bold, GdiCharSet=0" ForeColor="102, 102, 102"></Title>
   </Titles>
   <BorderSkin PageColor="Control" BackColor="CornflowerBlue" BackSecondaryColor="CornflowerBlue" />
</Chart>


Line Chart (Actual Revenue by Month)

The following is a line chart that shows the amount of revenue closed per month.

Line chart example

Data XML

The following is the contents of the Data XML string for this chart.

<datadefinition>
   <fetchcollection>
      <fetch mapping="logical" aggregate="true">
         <entity name="opportunity">
            <attribute groupby="true" alias="groupby_column" name="actualclosedate" dategrouping="month" /> 
            <attribute alias="aggregate_column" name="actualvalue_base" aggregate="sum" /> 
         </entity>
      </fetch>
   </fetchcollection>
   <categorycollection>
      <category>
         <measurecollection>
            <measure alias="aggregate_column" /> 
         </measurecollection>
      </category>
   </categorycollection>
</datadefinition>

Presentation XML

The following is the contents of the Presentation XML string for this chart.

<Chart Palette="BrightPastel">
   <Series>
      <Series _Template_="All" MarkerStyle="Circle" ShadowOffset="1" Color="Orange" BorderColor="64, 64, 64" BorderWidth="2" Font="Tahoma, 6.75pt" IsValueShownAsLabel="true" LabelForeColor="100, 100, 100" ChartType="Line">
         <SmartLabelStyle Enabled="True" />
         <Points />
      </Series>
   </Series>
   <ChartAreas>
      <ChartArea _Template_="All">
         <AxisY LineColor="LightGray" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" />
            <LabelStyle Font="Tahoma, 6.75pt" ForeColor="Gray" />
            <MajorGrid LineColor="LightSteelBlue" LineDashStyle="Dash" />
         </AxisY>
         <AxisX LineColor="LightGray" TitleFont="Tahoma, 8pt, GdiCharSet=0" TitleForeColor="100, 100, 100" LabelAutoFitMaxFontSize="7" LabelAutoFitMinFontSize="7">
            <MajorTickMark LineColor="Gray" />
            <LabelStyle Font="Tahoma, 6.75pt" ForeColor="Gray" />
            <MajorGrid LineColor="LightSteelBlue" LineDashStyle="Dash" />
         </AxisX>
      </ChartArea>
   </ChartAreas>
   <Titles>
      <Title _Template_="All" Font="Tahoma, 9pt, style=Bold, GdiCharSet=0" ForeColor="100, 100, 100"></Title>
   </Titles>
</Chart>

Pie Chart (Leads by Source)

The following is a pie chart that shows the total number of leads in your organization and where they came from.

Pie chart example

Data XML

The following is the contents of the Data XML string for this chart.

<datadefinition>
   <fetchcollection>
      <fetch mapping="logical" aggregate="true">
         <entity name="lead">
            <attribute groupby="true" alias="groupby_column" name="leadsourcecode" /> 
            <attribute alias="aggregate_column" name="fullname" aggregate="count" /> 
         </entity>
      </fetch>
   </fetchcollection>
   <categorycollection>
      <category>
         <measurecollection>
            <measure alias="aggregate_column" /> 
         </measurecollection>
      </category>
   </categorycollection>
</datadefinition>

Presentation XML

The following is the contents of the Presentation XML string for this chart.

<Chart Palette="BrightPastel">
   <Series>
      <Series _Template_="All" ShadowOffset="2" BorderColor="64, 64, 64" BorderDashStyle="Solid" BorderWidth="1" IsValueShownAsLabel="true" Font="Tahoma, 6.75pt, GdiCharSet=0" LabelForeColor="100, 100, 100" CustomProperties="DoughnutRadius=60, PieLabelStyle=Inside, PieDrawingStyle=SoftEdge" ChartType="pie">
         <SmartLabelStyle Enabled="True" /> 
         <Points /> 
      </Series>
   </Series>
   <ChartAreas>
      <ChartArea _Template_="All" BackColor="Transparent" BorderColor="Transparent" BorderDashStyle="Solid" /> 
   </ChartAreas>
   <Legends>
      <Legend _Template_="All" Alignment="Center" LegendStyle="Table" Docking="Bottom" IsEquallySpacedItems="True" BackColor="White" BorderColor="228, 228, 228" BorderWidth="0" Font="Tahoma, 8pt, GdiCharSet=0" ShadowColor="0, 0, 0, 0" ForeColor="100, 100, 100" /> 
   </Legends>
   <Titles>
      <Title _Template_="All" Font="Tahoma, 9pt, style=Bold, GdiCharSet=0" ForeColor="102, 102, 102" /> 
   </Titles>
   <BorderSkin PageColor="Control" BackColor="CornflowerBlue" BackSecondaryColor="CornflowerBlue" /> 
</Chart>

See Also

Concepts

Reference

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show: