Add Addtional Series with fitlers of Stacked Column Charts or Bar Charts in MS CRM 2011

2023-11-03


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” toChartType=”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.





   
   

    
    
     
     {C618533F-3784-E211-8B16-78E3B5114607}
    
    

    
    
     
     Aggregated Total on top of StackColumn chart
    
    

    
    
     
     opportunity
    
    

    
    

     
     

      
      

       
        
         
          -entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer"> 
          
          
           
          -entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer"> 
          
          
           
          -entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer"> 
          
          
           
          -entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer"> 
          
          
           
          
          
         
       

      
      

      
      

       
        
         
          
         
         
          
         
         
          
         
         
          
         
         
          
         
       

      
      

     
     

    
    

    
    

     
     

      
      

       
       

       
       

       
       

       
       

       
       

      
      

      
      

       
        
         
          
          
          
         
         
          
          
          
         
       

      
      

      
      

       
       

      
      

      
      

       
       

      
      

     
     

    
    

    
    
     
     false
    
    

   
   

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Add Addtional Series with fitlers of Stacked Column Charts or Bar Charts in MS CRM 2011 的相关文章

  • win10怎么设置WiFi与有线优先级

    原文 https blog csdn net u010921682 article details 88964982 经过测试 文章中第二种方式有效 不过我的优先级与原文中的不同 我是wifi优先于有线 如下 二 修改 接口跃点数 这个名词
  • Android的中http协议HttpURLConnection中post请求

    public class MainActivity extends AppCompatActivity private TextView textView Override protected void onCreate Bundle sa
  • Idea里面关于时间date报错Unhandled exception: java.text.ParseException的解决方案

    我一直报这个错找不到 结果是因为我导包的原因 idea自动导包导出来是这个 但是咱们需要的是这个 就不报错了
  • Lerna包管理

    认识lerna 导读 本章节主要讲解Lerna是什么 Lerna有什么用 如何使用Lerna进行npm包管理 大厂的Lerna版本管理策略是怎么做的 Lerna是如何实现本地包依赖管理以及底层原理是什么 读者可以带着这些问题去阅读 使学习事
  • 利用jni将Eclipse与C++、Opencv无缝连接

    利用jni将Eclipse与C Opencv无缝连接 博主 w风的季节 日期 2018 4 11 现在越来越多的大学生实验室或者创新项目需要用到将JAVA与C 之间的混合编程 因此本篇就来讲解一下Eclipse中用java写的APP如何将C
  • Spring Boot favicon.ico自定义设置

    做网页的都知道 网页打开后几乎都会有一个favicn的小图标 但是在spring boot中如何设置呢 下面告诉大家一个自定制的方法 非常简单 1 在配置application properties中加入 spring mvc favico
  • 信息熵,信息增益

    信息熵 信息增益 概要 实例一 实例二 概要 信息增益表示得知特征A的信息而使得类Z的信息的不确定性减少的程度 特征A对数据集D的信息增益 G D A 定义为集合的信息熵 H D 与特征A给定条件下D的信息条件熵 H D A 之差 即公式为
  • 机器学习入门-提取文章的主题词 1.jieba.analyse.extract_tags(提取主题词)

    1 jieba analyse extract tags text text必须是一连串的字符串才可以 第一步 进行语料库的读取 第二步 进行分词操作 第三步 载入停用词 同时对分词后的语料库进行停用词的去除 第四步 选取一段文本分词列表
  • 关于ASP.NET邮件发送的学习心得

    ASP net邮件发送是一种非常常见的功能 它可以让我们在网站中实现发送邮件的功能 比如用户注册成功后发送欢迎邮件 或者是找回密码时发送重置密码邮件等等 在学习ASP net邮件发送的过程中 我总结了以下几点心得 一 SMTP服务器的配置
  • 【解决问题】Transaction was marked for rollback only; cannot commit

    问题现象 导入文件的时候直接报错 Transaction was marked for rollback only cannot commit nested exception is org hibernate TransactionExc
  • JavaScript运算符详解

    JavaScript运算符详解 目录 JavaScript运算符详解 1 算术运算符 1 1 加法运算符 1 1 1 基本运算规则 1 1 2 对象的相加 1 2 余数运算符 1 3 自增和自减运算符 1 4 正负数值运算符 1 5 指数运
  • C单元测试框架——CMockery (3)中文手册

    Cmockery 单元测试框架 翻译的匆忙 没有校验 纰漏之处感谢请指正 转载请注明来自 see see 版权归原文 所有 Cmockery 是一个轻量级的库 作者用它来做C单元测试 目录 动机 概述 执行测试 异常处理 出错处理 断言 断
  • 河南省历年高考人数(2004-2021)

    一年一度高考时 我的高考已经过去15年了 河南高考人数创了新高 搜了一下历年人数 自己画了一个图
  • 前端XMLHttpRequest发送请求

    export function filePreview fileName ftpDownloadPath departmentId let mockXHR new XMLHttpRequest mockXHR open post baseU
  • python中的is None和==None

    1 python代码if not x 和if x is not None 和if not x is None 使用 2 python 中None is 和 的深入探讨 3 Python中为什么要用 is None 来代替 None

随机推荐