Debug Mode (Window) |
The debug mode in FusionCharts helps you look into what is happening behind the chart scenes. It also lists out any errors, if present. You can use the debug window to trouble shoot all your charts. The debug window lists errors like:
In each FusionCharts chart, you can activate the debug mode by just setting the FCDebugMode attribute to true. A typical debug window for a chart that rendered successfully using dataURL method looks as under: |
![]() |
Here, you can see a Column 2D Chart with its Debug Window. The Debug Window contains a lot of information about the chart. The contents of the above debug window can be listed as under: |
Info: Chart loaded and initialized.
INFO: XML Data provided using dataURL method. |
From the above Debug Window, you can get the following information:
To hide the debug window and see the chart below, in Debug Mode, you can click inside the respective chart and then press Shift + D. To show it back, again press Shift + D. |
Enabling the debug Mode |
To enable the debug mode for any of your charts, you just need to set the FCDebugMode attribute to true. |
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.fusioncharts.components.*"> <ns1:FusionCharts x="30" y="24" FCChartType="Column2D" FCDataURL="data.xml" FCDebugMode="true"/> </mx:Application> |
Invalid XML Provided |
In this example, we provide invalid XML to the chart. We've intentionally not closed one of our <set> elements. The entire XML is listed below: |
<chart caption='Monthly Sales Summary'
subcaption='For the year 2006' xAxisName='Month' yAxisName='Sales' numberPrefix='$'> <set label='Jan' value='17400' /> <set label='Feb' value='19800' /> <set label='Mar' value='21800' /> <set label='Apr' value='23800' > <set label='May' value='29600' /> <set label='Jun' value='27600' /> <set label='Jul' value='31800' /> <set label='Aug' value='39700' /> <set label='Sep' value='37800' /> <set label='Oct' value='21900' /> <set label='Nov' value='32900' /> <set label='Dec' value='39800' /> </chart> |
When you run your chart against this XML, you'll get an "Invalid XML Data" message on the chart and the debug window would look as under: |
![]() |
You can see the reason for Invalid XML data above. FusionCharts detects it for you and then shows the appropriate message. To get more information on error, you can click the dataURL Invoked link and open the XML file in browser. |
Invalid STYLE definition Errors |
FusionCharts Debug Window can also capture the following errors in your STYLE definitions:
Let's consider the XML example below. Errors in style XML are represented in bold: |
<chart caption='Monthly Sales Summary'
subcaption='For the year 2006' xAxisName='Month' yAxisName='Sales' numberPrefix='$'> <set label='Jan' value='17400' /> <set label='Feb' value='19800' /> <set label='Mar' value='21800' /> <set label='Apr' value='23800' /> <set label='May' value='29600' /> <set label='Jun' value='27600' /> <set label='Jul' value='31800' /> <set label='Aug' value='39700' /> <set label='Sep' value='37800' /> <set label='Oct' value='21900' /> <set label='Nov' value='32900' /> <set label='Dec' value='39800' /> <styles> |
Here, we've the following errors in style XML:
When you run a chart against this XML, you'll see the following errors raised in debug mode: |
![]() |
As you can see, all our errors got caught in the Debug Window and now you can use this effectively to correct your style XML. There are more errors and messages that debug window can trap, which we've not shown here. Examples: when you update your chart's data at client using AJAX, all transfer messages are logged so that you easily debug into the application process. The Debug Window is aimed at making your lives simpler as developers. |