Showing posts with label Chart. Show all posts
Showing posts with label Chart. Show all posts

Tuesday, January 27, 2015

MS CRM Chart - Axis labels sorting by month



In above chart, all month are not shown in correct order.
To correct the order / sort those labels, we need to export chart XML.
In Chart XML, need to look for FetchCollection
<fetchcollection>
  <fetch mapping="logical" aggregate="true">
    <entity name="new_test">
      <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" dategrouping="month" name="new_date" />
      <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="new_phone" aggregate="count" />
    </entity>
  </fetch>
</fetchcollection>

Update this fetchXML with 


<fetchcollection>
  <fetch mapping="logical" aggregate="true">
    <entity name="new_test">
      <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" dategrouping="month" name="new_date" />
      <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="new_phone" aggregate="count" />
      <order alias="_CRMAutoGen_groupby_column_Num_0" descending="false"/>
    </entity>
  </fetch>
</fetchcollection>

Notice that I used alias of my Date attribute for order. 

Save your XML and reimport to CRM, publish and done..
Now your chart will be look like