Range Bar Charts (How to implement multiple y value charts)

Unanswered Range Bar Charts (How to implement multiple y value charts)

  • Wednesday, 2 May 2012 2:23 PM
     
      Has Code

    I have need to create a chart of the type RangeBar in CRM.  I have done fairly extensive customization of the XML code for Dynamics CRM 2011 charts but this particular problem is baffling me.

    For this type of chart you need to have two Y values per point which I've implemented.  My problem appears to be with getting the bottom axis to behave correctly.  It's currently aggregating on Count(scheduledstart) but in my mind the axis shouldn't be an aggregation at all, it should simply be a timeline.  All my attempts to remove this aggregation have failed.

    I don't need a full solution, even a chunk of XML code from another multiple Y value chart should be enough to get me going.

    Thanks in advance!


    <visualization>
      <visualizationid>{DA810354-8993-E111-8F98-005056AE004F}</visualizationid>
      <name>Z-Campaign Activities</name>
      <primaryentitytypecode>campaignactivity</primaryentitytypecode>
      <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true">
              <entity name="campaignactivity">
    			  <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="true" />
    			  <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="activityid" />
    			  <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="scheduledstart" aggregate="count" />
    			  <attribute alias="_CRMAutoGen_aggregate_column_Num_1" name="scheduledend" aggregate="count" />
    		  </entity>
            </fetch>
          </fetchcollection>
    		<categorycollection>
    			<category alias="_CRMAutoGen_groupby_column_Num_0">
    				<measurecollection>
    					<measure alias="_CRMAutoGen_aggregate_column_Num_0" />
    					<measure alias="_CRMAutoGen_aggregate_column_Num_1" />
    				</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 YValuesPerPoint="2" YValueMembers="_CRMAutoGen_aggregate_column_Num_0,_CRMAutoGen_aggregate_column_Num_1" ChartType="RangeBar" IsValueShownAsLabel="True" BorderWidth="3" MarkerStyle="Square" MarkerSize="9" MarkerColor="37, 128, 153" MarkerBorderColor="37, 128, 153" CustomProperties="EmptyPointValue=Zero">
    		</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">
                <MajorTickMark LineColor="165, 172, 181" />
                <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>

    • Edited by ToxicDice Wednesday, 2 May 2012 2:30 PM
    •  

All Replies

  • Wednesday, 30 May 2012 12:36 PM
     
     
    Bumpity Bump
  • Wednesday, 30 May 2012 9:56 PM
     
      Has Code

    There is no direct way to achieve what you are trying.

    Here is one convoluted solution:

    1. Create custom attribute integer representation of "scheduledstart" and "scheduledend" in format YYYYMMDD ie 5/30/2012 is represented as 20120530

    2. Using these you can plot a rangebar chart using the following data description:

     <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" >
              <entity name="campaignactivity">
    			  <attribute name="new_int_scheduledstart"/>
    			  <attribute name="new_int_scheduledend" />
    		  </entity>
            </fetch>
          </fetchcollection>
    		<categorycollection>
    			<category >
    				<measurecollection>
    					<measure alias="new_int_scheduledstart" />
    					<measure alias="new_int_scheduledend" />
    				</measurecollection>
    			</category>
    		</categorycollection>
    	</datadefinition>
      </datadescription>


    Murali