How to use the Web Part "Chart From XML"

Purpose of this lesson

This lesson describes how to use the Web Part "Chart From XML". This Web Part is intended to be used by developers to provide advanced charting functionality that is not covered by the Web Part "Chart From List". The basic principle of the "Chart From XML" web part is to chart directly from an XML input that can be static or dynamic, as well as internal or external.
  • 1 - Add a Chart From XML Web Part on a page
Simply add a chart from XML web part to any page
  • 2 - Edit the settings of the Web Part
Open the configuration pane to edit settings
  • 3 - Give the XML Input
You have two options to provide XML input :
- Option 1 : Provide an URL (internal or external) that will provide the XML content.
- Option 2 : Provide the XML Content directly. This means that the XML content will be static
  • 4 - What XML format should I use
The syntax that should be used is described on the Fusion Charts Free Documentation web site

You will find plenty of examples for each charts. To start with, you can try to copy and pasting those examples into "Chart Xml Content" and select the appropriate chart type.
  • 5 - Example
- Select the chart type "FCF_MSBar2D"

- Copy paste the following XML Content into the "Chart Xml Content" field

<graph caption='Business Results 2005 v 2006' xAxisName='Month' yAxisName='Revenue'
  showValues='0' numberPrefix='$' decimalPrecision='0' bgcolor='F3f3f3' bgAlpha='70' 
  showColumnShadow='1' divlinecolor='c5c5c5' divLineAlpha='60' showAlternateHGridColor='1' 
  alternateHGridColor='f8f8f8' alternateHGridAlpha='60' >

  <categories>
    <category name='Jan' />
    <category name='Feb' />
    <category name='Mar' />
    <category name='Apr' />
    <category name='May' />
    <category name='Jun' />
    <category name='Jul' />
    <category name='Aug' />
    <category name='Sep' />
    <category name='Oct' />
    <category name='Nov' />
    <category name='Dec' />
  </categories>

  <dataset seriesName='2006' color='c4e3f7' >
    <set value='27400' />
    <set value='29800' />
    <set value='25800' />
    <set value='26800' />
    <set value='29600' />
    <set value='32600' />
    <set value='31800' />
    <set value='36700' />
    <set value='29700' />
    <set value='31900' />
    <set value='34800' />
    <set value='24800' />
  </dataset>

  <dataset seriesName='2005' color='Fad35e' >
    <set value='10000'/>
    <set value='11500'/>
    <set value='12500'/>
    <set value='15000'/>
    <set value='11000' />
    <set value='9800' />
    <set value='11800' />
    <set value='19700' />
    <set value='21700' />
    <set value='21900' />
    <set value='22900' />
    <set value='20800' />
  </dataset>

  <trendlines>
    <line startValue='26000' color='91C728' displayValue='Target' showOnTop='1'/>
  </trendlines>

</graph>

- It is done, you will get a nice chart

Last edited Feb 13, 2013 at 5:49 PM by PerrySharePoint, version 13

Comments

nino2009 Feb 20, 2013 at 9:43 PM 
Same here, once I paste the above XML Content into the "Chart Xml Content" field
I get blank!!!!
Help please

gbhardin Jun 15, 2012 at 9:30 PM 
I see nothing when I follow directions, webpart shows up blank

sujeetji Apr 17, 2010 at 10:39 PM 
Hi,

this is a very good post, I want to know is it possible for me to develop a webpart and from my developed webpart if i can assign value for

"XML Content directly"

on your webpart, could you please help me, how I can do this.

Thanks in advance

Regards,