When trying to make a chart using FusionCharts, if you get any errors (or if the chart doesn't render), there could a lot of reasons for it. Here, we'll try and cover them up. We've divided the entire debugging process into three sections:

  • Basic Troubleshooting - Manual methods to solve such problems.
  • Using the Debug Mode - Using Debug Window that helps you un-earth the problems with your chart. We'll cover that in next page.
  • Using the FusionCharts JavaScript class - Mechanism to debug charts using JavaScript events and error handlers.

Let's us cover basic trouble shooting first. While creating your chart, if for some reason you do not see your chart like it should, check for the following actions:

"Movie not Loaded" message or No chart is shown

When viewing your page containing the chart, if you see an endless loading progress bar in your browser, or if the right click menu (right click at the place where the chart is supposed to be) shows "Movie not loaded", check the following:

  • Check if the SWF path is properly provided in your HTML page is correct. Also, check if the SWF file actually exists there.
  • If you're working on a case-sensitive file system Operating System, check for the case of path and SWF file.
  • Check if you've Adobe Flash Player 8 (or above) installed on your machine.
  • Check whether you've enabled your browser to show ActiveX controls. Normally, all browsers are Flash-enabled.

"Error in Loading Data" message

If you get a "Error in Loading Data" message in your chart, it means that FusionCharts could not find XML data at the specified URL. In that case, check the following:

  • Check if you've actually provided dataURL or dataXML. If you do not provide either, FusionCharts looks for a default Data.xml file in the same path. Now, if that is also not found, it shows the "Error in Loading Data" error.
  • If you're using dataURL method, paste this URL in your browser to check if it's returning a valid XML. Make sure, there are no scripting or time-out errors and a valid XML is being returned. Also make sure that the XML isn't intermingled with HTML content. The data provider page should return a clean XML only - not even HTML <head> or <body> tags.
  • Make sure you're passing relative URLs for dataURL, and not absolute URLs. To restrict cross site security attacks, FusionCharts doesn't allow colons in dataURL (starting v3.0.5). So you cannot specify dataURL as http://.../path/file.ext any more.
  • If you have to pass parameters to your dataURL data provider page from FusionCharts, make sure they're URLEncoded in the dataURL, when providing to FusionCharts. e.g., if your dataURL needs to be Data.asp?id=43&subId=454, you'll need to Url Encode it so that it becomes Data%2Easp%3Fid%3D43%26subId%3D454. Only then FusionCharts will invoke the URL with proper parameters appended to it.
  • When using dataURL method, make sure that the SWF File and data provider page are on the same sub-domain. Due to Flash's sandbox security model, it cannot access data from external domains, unless otherwise configured.

"Invalid XML Data" message

If you get an "Invalid XML Data" message, it means that the XML data document is malformed. Check it for common errors like:

  • Differences in case of tags. e.g., <chart> should end with </chart> and not </Chart> or </CHART>
  • Missing opening/closing quotation marks for any attributes. e.g., <chart caption=Monthly Sales' ..> should be <chart caption='Monthly Sales' ..>
  • Missing closing tag for any element. e.g., <set label='Services' value='26' > should be <set label='Services' value='26' />
  • If you're using any special characters in your XML, make sure they're properly encoded. e.g., in dataXML method, % needs to be encoded as %25, & as %26 and so on. In dataURL method, you can provide most of the characters directly, without the need to encode.
  • In dataXML method, check for conflict of ' (XML Attribute Character) and " (HTML Parameter Character). e.g., if you're using direct HTML embedding method, and using " for HTML parameters, then you need to make sure that all your XML attributes use ' as containers.

    Example:

    <param name="FlashVars" value="<chart showLabels='1' showValues='1'>...</chart>" />

  • If you've quotes as part of your data, XML Encode them to &apos; e.g., <set name='John&apos;s House' />
  • To get more information on what the error in XML is, you can either use the Debug Window (explained in next section) or open the XML in your browser.

"No data to display" message

If your chart shows a "No data to display" message, it could be the following scenarios:

  • Your XML data doesn't contain any data that could be plotted by FusionCharts. In this case, your XML just contains the <chart> or <dataset> tags without any data between them.
  • You might be using a single-series chart SWF and providing data in multi-series format or vice-versa. In this case too, you'll get a "No data to display" message.
  • In some Dual Y Combination charts, you need to provide at least one dataset for both the axis. Otherwise, you'll get a "No data to display" message.

The chart appears but is squeezed up at top-left corner with everything illegible

Please make sure that:

  • You've specified the width and height of chart in pixel values and without any string after it. e.g., specify 200 instead of 200px.
  • You're not specifying the chart width and height in %.
  • If using direct HTML OBJECT/EMBED code to embed the charts, please provide the following additional parameters to FlashVars:

    <object ... >
         ...
        <param name="FlashVars" value="&dataURL=Data.xml&chartWidth=300&chartHeight=250">
         ...
        <embed src="../FusionCharts/Column3D.swf" flashVars="&dataURL=Data.xml&chartWidth=300&chartHeight=250".../>
    </object>

Next, we'll see how to use the Debug Window to trouble shoot.