1

在 CRM 2011 中,我有几条记录包含两个状态(可为空的布尔值)字段。我想绘制一个条形图,计算所有记录的真值和假值的数量,并将它们绘制在同一个图表中(“真”记录的条和“假”记录的条)。

这是修改后的 XML I(最初使用 CRM 生成),对于我来说,我无法弄清楚如何用 2 个值绘制图表,我每个月有多个记录,所以横轴是记录 cretedOn 日期(月)。

谁能解释我将如何修改 XML 来实现这一点?或者向我指出一个解释该做什么的资源?

    <visualization>
  <visualizationid>{CCA96081-E319-E211-B2CA-0800273EE9D1}</visualizationid>
  <name>Compliance Stages 1 &amp; 2, Chart 1</name>
  <primaryentitytypecode>intellic_suppliersalesprocess</primaryentitytypecode>
  <datadescription>
    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true">
          <entity name="intellic_suppliersalesprocess">
            <attribute alias="aggregate_column" name="intellic_csvfileimported" aggregate="count" />
        <filter>
           <condition attribute="intellic_csvfileimported" operator="eq" value="true" />
        </filter>
        <attribute alias="aggregate_column1" name="intellic_csvfileimported" aggregate="count" />
        <filter>
           <condition attribute="intellic_csvfileimported" operator="eq" value="false" />
        </filter>
            <attribute groupby="true" alias="groupby_column" dategrouping="month" name="createdon" />
          </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category>
          <measurecollection>
            <measure alias="aggregate_column" />
          </measurecollection>
      <measurecollection>
            <measure alias="aggregate_column1" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>
  </datadescription>
  <presentationdescription>
    <Chart>
      <Series>
    <Series IsValueShownAsLabel="True" Color="110, 20, 78" BackGradientStyle="TopBottom" BackSecondaryColor="141, 44, 45" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
        <Series IsValueShownAsLabel="True" Color="55, 118, 193" BackGradientStyle="TopBottom" BackSecondaryColor="41, 88, 145" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
      </Series>
      <ChartAreas>
        <ChartArea BorderColor="White" BorderDashStyle="Solid">
          <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" />
          </AxisY>
          <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
            <MajorGrid LineColor="Transparent" />
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
          </AxisX>
        </ChartArea>
      </ChartAreas>
      <Titles>
        <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title>
      </Titles>
    </Chart>
  </presentationdescription>
  <isdefault>false</isdefault>
</visualization> 

任何建议都会非常感激。

杰克

4

1 回答 1

1

您需要有两个系列,每个系列都需要对记录数进行汇总,但要根据您的位字段过滤一组记录。因此,虽然典型的两个系列图表可能会绘制每个月的新客户数量和新潜在客户数量(例如),但在这里您想要绘制相同的实体两次,在每种情况下进行计数,但过滤正在计数的记录。作为一个有用的比较示例,有一个内置图表显示机会作为赢得的交易与失败的交易。在此示例中,它计算所有赢得的机会的实际收入总和,以及失去的机会的估计收入总和。您可以找到此图表并将其导出,我已将其粘贴在下面以方便参考:

<visualization>
      <visualizationid>{C1CB81B1-575F-DF11-AE90-00155D2E3002}</visualizationid>
      <name>Deals Won vs. Deals Lost By Owner</name>
      <description>Shows the amount of revenue for won deals versus lost deals.</description>
      <primaryentitytypecode>opportunity</primaryentitytypecode>
      <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true">
              <entity name="opportunity">
                <link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
                  <attribute alias="sum_lost" name="estimatedvalue" aggregate="sum"></attribute>
                  <filter>
                    <condition attribute="statecode" operator="eq" value="2" />
                  </filter>
                </link-entity>
                <link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
                  <attribute alias="sum_won" name="actualvalue" aggregate="sum"></attribute>
                  <filter>
                    <condition attribute="statecode" operator="eq" value="1" />
                  </filter>
                </link-entity>
                <attribute groupby="true" alias="groupby_column" name="ownerid"></attribute>
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category>
              <measurecollection>
                <measure alias="sum_won" />
              </measurecollection>
              <measurecollection>
                <measure alias="sum_lost" />
              </measurecollection>
            </category>
          </categorycollection>
        </datadefinition>
      </datadescription>
      <presentationdescription>
        <Chart Palette="None" PaletteCustomColors="97,142,206; 168,203,104; 209,98,96; 142,116,178; 93,186,215; 255,155,83; 148,172,215; 217,148,147; 189,213,151; 173,158,196; 145,201,221; 255,180,138">
          <Series>
            <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">
              <SmartLabelStyle Enabled="True" />
            </Series>
            <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">
              <SmartLabelStyle Enabled="True" />
            </Series>
          </Series>
          <ChartAreas>
            <ChartArea BorderColor="White" BorderDashStyle="Solid">
              <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181">
                <MajorGrid LineColor="239, 242, 246" />
                <MajorTickMark LineColor="165, 172, 181" />
                <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">
                <MajorGrid Enabled="False" />
                <MajorTickMark Enabled="False" />
                <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
              </AxisX>
            </ChartArea>
          </ChartAreas>
          <Titles>
            <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
          </Titles>
          <Legends>
            <Legend Alignment="Center" LegendStyle="Table" Docking="Bottom" Font="{0}, 11px" ForeColor="59, 59, 59"></Legend>
          </Legends>
        </Chart>
      </presentationdescription>
      <isdefault>false</isdefault>
    </visualization>

注意到每个链接实体中的“过滤器”标签了吗?另请参阅定义系列的两个“度量集合”,以及用于呈现这些的两个条目,例如颜色。

于 2012-10-24T11:47:38.963 回答