CRM 2011图表 - 如何在图例中显示所有值?

时间:2012-07-09 13:12:18

标签: dynamics-crm-2011 asp.net-charts fetchxml

使用默认的CRM 2011销售阶段漏斗图机会,即使每个阶段没有数据,如何让它显示图例中的所有阶段?这似乎是一个简单的问题,但我很难过。

图表仅显示由Fetch检索的数据,而Fetch不一定每个阶段至少有一条记录。此外,漏斗图表不能包含多个系列。

这是我提出的,但它不能作为漏斗图表。交换到雷达图至少对布局来说这种类型的数据毫无价值。

<visualization>
  <visualizationid>{BA88CAC2-637F-E011-8E24-00155D840900}</visualizationid>
  <name>Opportunities by Sales Stage</name>
  <primaryentitytypecode>opportunity</primaryentitytypecode>
  <datadescription>
    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true">
            <entity name="opportunity">
                <attribute alias="aggregate_column_1" name="opportunityid" aggregate="count" />
                <attribute groupby="true" alias="groupby_column" name="salesstagecode">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="1" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_2" name="opportunityid" aggregate="count">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="200000" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_3" name="opportunityid" aggregate="count">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="200001" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_4" name="opportunityid" aggregate="count" >
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="200002" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_5" name="opportunityid" aggregate="count">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="100000000" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_6" name="opportunityid" aggregate="count">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="100000001" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_7" name="opportunityid" aggregate="count" >
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="100000002" />
                    </filter>
                </attribute>
                <attribute alias="aggregate_column_8" name="opportunityid" aggregate="count">
                    <filter type="or">
                        <condition attribute="salesstagecode" operator="eq" value="100000003" />
                    </filter>
                </attribute>
            </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category>
          <measurecollection>
            <measure alias="aggregate_column_1" />
          </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_2" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_3" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_4" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_5" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_6" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_7" />
            </measurecollection>
            <measurecollection>
                <measure alias="aggregate_column_8" />
            </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="Funnel" Name="o:salesstagecode,1" Color="55,118,193" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,200000" Color="197,56,52" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,200001" Color="149,189,66" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,200002" Color="117,82,160" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,100000000" Color="49,171,204" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,100000001" Color="255,136,35" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,100000002" Color="97,142,206" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
          <Series ChartType="Funnel" Name="o:salesstagecode,100000003" Color="209,98,96" IsValueShownAsLabel="true" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="FunnelLabelStyle=Outside, FunnelNeckHeight=0, FunnelPointGap=1, FunnelNeckWidth=5 ">
              <SmartLabelStyle Enabled="True" />
          </Series>
      </Series>
      <ChartAreas>
        <ChartArea>
          <Area3DStyle Enable3D="True" />
        </ChartArea>
      </ChartAreas>
      <Legends>
        <Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
      </Legends>
      <Titles>
        <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
      </Titles>
    </Chart>
  </presentationdescription>
  <isdefault>false</isdefault>
</visualization>

有没有人有更好的方法来做到这一点?

1 个答案:

答案 0 :(得分:0)

您的方法不起作用,因为正如您所提到的,漏斗图表不幸地不允许多个系列。 如果是这样,您还需要在每个属性周围添加标签并进行过滤,以使过滤器正常工作。

我假设您的漏斗图显示了每个阶段的总和,因此您可以为每个阶段添加虚拟记录,并确保它们包含在您的视图中。在虚拟记录上,值为0,因此它们不会对总和做出贡献。您需要在包含时使用高级查找创建一点创意。它们。

您可以在此处查看更高级的方法来添加虚拟记录http://crmchartguy.wordpress.com/2013/01/23/include-records-with-no-value-in-charts/

如果你有一个堆积的柱形图,你使用xml的方法会有效,尽管你需要添加上面提到的标签。您可以在此处查看http://crmchartguy.wordpress.com/2013/03/10/aggregate-total-on-top-of-stacked-column-charts-or-bar-charts-in-ms-crm-2011/

的示例