Create dynamic Fusion charts from SharePoint lists

Insert an empty DVWP then select the source list and add required columns, then edit the XSLT. Look for dvt_1.body tag and replace the contents in it with the below code.

Note: You need to upload the Fusion charts in any library first, before referencing the charts

<xsl:template name=”dvt_1.body”>

<xsl:param name=”Rows”/>

#This is what you need to insert

<xsl:variable name=”varColorString” select=”‘XXXXXXAFD8F8F6BD0F8BBA00FF8E46008E8ED646468E468E588526B3AA00008ED69D080DA186BE'” />
<xsl:variable name=”varChartValue”>
<xsl:for-each select=”$Rows[not(preceding-sibling::Row/@Status = @Status ) and @Status!=”]”>
<xsl:sort select=”@Status”/>
<xsl:variable name=”varTemp” select=”@Status”/>

&lt;set name=&apos;<xsl:value-of select=”(@Status)”/>&apos; value=&apos;<xsl:value-of select=” count($Rows[@Status = $varTemp])”/>&apos; /&gt;
<xsl:variable name=”varChartData”>
&lt;graph caption=&apos;Open risks &apos; xAxisName=&apos;Project Name&apos; yAxisName=&apos;Count&apos; showNames=&apos;1&apos; decimalPrecision=&apos;0&apos; formatNumberScale=&apos;0&apos; pieYScale=&apos;45&apos; pieRadius=&apos;70&apos; animation=&apos;1&apos; shadowXShift=&apos;4&apos; shadowYShift=&apos;4&apos; shadowAlpha=&apos;40&apos; pieFillAlpha=&apos;95&apos; &gt;
<xsl:value-of select=”$varChartValue” />



#End here



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s