Monday, March 26, 2012

Create Pie Chart from SharePoint Task list using Fusion Charts

Two years back, I posted an article on Creating Fusion Charts in SharePoint.(Refer this article for step by step instructions to create Fusion charts, Just replace the below given XSL)  There is a similar request today, But this time, I had to create a Pie Chart from SharePoint Task List. Requirement is just to display the Chart based on the Task Status counts.

Here is my XSL

<xsl:template name="dvt_1.body">
  <xsl:param name="Rows"/>
    <xsl:variable name="varNotStarted" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Not Started'])" /> 
    <xsl:variable name="varInProgress" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'In Progress'])" /> 
    <xsl:variable name="varCompleted" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Completed'])" /> 
   <xsl:variable name="varDataset">
                 &lt;set name=&apos;Not Started&apos; color=&apos;FF6666&apos; value=&apos;<xsl:value-of select="$varNotStarted"/>&apos;  /&gt;
                 &lt;set name=&apos;In Progress&apos; color=&apos;66A866&apos; value=&apos;<xsl:value-of select="$varInProgress"/>&apos;  /&gt;
                 &lt;set name=&apos;varCompleted&apos; color=&apos;0B9CFD&apos; value=&apos;<xsl:value-of select="$varCompleted"/>&apos;  /&gt;
 <xsl:variable name="varChartData">
      &lt;graph caption=&apos;&apos; showPercentValues=&apos;1&apos; decimalPrecision=&apos;0&apos; showValues=&apos;1&apos;  showLegend=&apos;1&apos; showNames=&apos;1&apos;  &gt;
      <xsl:value-of select="$varDataset" />
         <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="500">
          <param name="movie" value=";chartHeight=500" >
            <xsl:text xmlns:ddwrt="" ddwrt:whitespace-preserve="yes" xml:space="preserve">
            <param name="FlashVars" value="&amp;dataXML={$varChartData}&amp;chartWidth=500&amp;chartHeight=400"><param name="quality" value="high" /></param></param>  </object>

and my Chart with data:
Related Fusion Chart Articles:

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:


  1. Hi Salaudeen,

    This is Rishi from the FusionCharts Team.

    We're glad to see your article about FusionCharts with Sharepoint.

    We would like to let you know that FusionCharts has a product which provides charting for Sharepoint - known as Collabion Charts for Sharepoint. You can read more about it here -

    Let us know about your experience with Collabion.


Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...