FusionCharts for Flex > Debugging > Basic Troubleshooting

Basic Troubleshooting

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

  • Basic Troubleshooting - In this section we will discuss various manual problem solving methods.
  • Using the Debug Mode - FusionCharts and FusionWidgets provide a Debug Window through which you can detect the cause of the problems, which you are having with your chart/widget. In this section we will show you how to use the Debug Window.
  • Using FCErrorEvent - An event is triggered by FusionCharts for Flex Component when error occurs. This section focus on how to handle the event and determine errors.

Let's deal with basic trouble shooting first. While creating your chart/widget, if for some reasons you do not see your chart/widget like it should , check for the following errors:

SWF Movie not Loading or No chart shown

When viewing your chart/widget in a browser, if you find that the chart/widget loading process is continuing endlessly, or if the right click menu (right click at the place where the chart/widget is supposed to be) shows 'Movie not loaded', check the following:

  • Check whether the path to the SWF file, provided in your MXML code is correct. Also, check if the SWF file actually exists at the specified location.
  • If you're using an Operating System, which has a case-sensitive file system, check the case of path and SWF file.
  • Check if you've Adobe Flash Player 9 (or above) installed on your machine.
  • Check whether you've enabled your browser to show JavaScript / ActiveX controls. Normally, all browsers are Flash-enabled and JavaScript enabled.

"Error in Loading Data" message

If you see the "Error in Loading Data" message in your chart/widget, it means that FusionCharts could not find XML data at the specified URL. If this is the case, check the following:

  • Check if you've actually provided the valid path for FCDataURL.
  • If you're using the FCDataURL method, paste this URL in your browser to check if it is returning a valid XML. Make sure that there are no scripting or time-out errors and a valid XML is being returned. Also confirm that the XML isn't intermingled with HTML content. The data provider page should return clean XML only - not even HTML <head> or <body> tags.
  • If you have to pass parameters to your data provider page from FusionCharts, check they are URL Encoded in FCDataURL.
    For example if your FCDataURL is Data.asp?id=43&subId=454, you need to URL Encode it so that it becomes Data%2Easp%3Fid%3D43%26subId%3D454. Only then will FusionCharts invoke the URL, with proper parameters appended to it.
  • When using FCDataURL method, please confirm 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 again for common errors like:

  • Difference in case of tags. <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.
  • If you are using FCdataXML method, check for conflict between characters used for denoting XML attributes and the character used for denoting HTML attributes. For example, if you are using direct HTML embedding method, and enclosing HTML parameters with a pair of double quotes ("), then you must enclose all XML attributes in single quotes ('). Example: <param name="FlashVars" value="<chart showLabels='1' showValues='1'>... </chart>" />
  • If you have quotes as part of your data, XML Encode them to &apos; Example: <set name='John&apos;s House' />
  • if you still can't locate the error in the XML code. You can either use the Debug Window (explained next) or open the XML in your browser and manually check for errors.

"No data to display" message

If your chart displays a "No data to display" message, it could be due to following reasons:

  • Your XML data doesn't contain any data that can be used for plotting a chart/widget. In this case, your XML just contains the <chart> or <dataset> tags without any data contained in it.
  • If you use single-series chart SWF and provides data in multi-series format or vice-versa, you'll receive "No data to display" message.
  • In some Dual Y Combination charts, you need to provide at-least one data-set for both the axis. Otherwise, you'll receive a "No data to display" message.

In the next section we'll show you how to troubleshoot errors with the help of the Debug Window.

Default data is not shown upon chart load

Prior to FusionCharts for Flex v1.1, the chart use to show a default sample dummy data on chart when no data is provided to a chart. From now on, the charts no longer show default data if the default data related properties are not specified. You can choose to show the default data by setting FCUseDefaultData attribute of FusionCharts/FusionWidgets component to true. By default the FCUseDefaultData property is set to false, and your chart/widget will display the "No data to display" message if you do not provide any data. You can still use FCUseDefaultData (true) in conjunction with the FCChartType property to show default data (sample dummy data) for the different chart types.

Flex API is not working

When calling upon the various methods provided by the Flex API if for some reason they fail to work, it could be due to the following reason:

  • Check whether you've enabled your browser to show JavaScript / ActiveX controls. Normally, all browsers are Flash-enabled and JavaScript enabled.
  • Make sure the Flash player Global Security Settings are properly configured. You can learn to set the policies at the Setting Flash Security Policies section.
  • In case of Image/PDF export functionality, make sure the application is compiled in Flex SDK 3.3 or above and for Flash Player 10 or above.