I received e-mails asking for more details about my XML+Flash chart demo, so here are the answers to some frequently asked questions.
Where do you put the swf file? And how do I point to it?
The swf is a small file and can easily be stored in a document library, in your SharePoint farm. You can then point to it using its URL, as you would with any other file. For example, here is the location of my doughnut flash chart:
How did you create the XML file and the code to display the chart?
I didn’t create them, I just reused an existing example proposed on the FusionCharts site. The idea behind this technique is that in SharePoint you can reuse XML driven charts that were initially created for standard Web pages.
If you use FusionCharts v3, you’ll find examples in the gallery (I took my example from the pie/doughnut category). For the free FusionCharts v2 version, the examples are here.
To make an example work on your SharePoint site you need three components:
– the XML file containing the data (click on “View XML” in the example you have chosen)
– the charting component (swf file) that you get from the FusionCharts package
– the HTML and script that you’ll include in your SharePoint page. To get it, display an example and view the source code.
My demo uses FusionCharts, but you can apply this method to any XML driven component.
Is there a specific webpart for the HTML and script, or do you use a Content Editor Web Part?
As usual, I rely on the CEWP to include the HTML and script in the page.
If your data is stored in SharePoint list, how can you get it in XML format?
There are several ways to do this (and none of them is perfect):
– URL protocol
– Web Services
– RSS feed