Debug Mode (Window) |
FusionCharts/FusionWidgets debug mode gives you an insight into the complex process that goes into rendering a chart. The debug mode can also assist you in tracking errors. With the help of the debug mode you can easily track following errors:
To activate the debug mode of a chart – just set the FCDebugMode attribute of FusionCharts/FusionWidgets component to true. Following is an image of the debug window of a chart, which has loaded successfully using FCDataURL method. |
![]() |
The image (above) shows a column 2D chart with its Debug Window. The Debug Window displays following information about the chart: |
Info: Chart loaded and initialized.
INFO: XML Data provided using dataURL method. |
The Debug Window provides following vital information about the chart:
To bring the chart to the foreground – click on the chart and then press Shift + D. You can use Shift + D to switch back to the debug mode. |
Enabling the debug Mode |
To enable the debug mode of a chart/widget you just need to set the FCDebugMode attribute of FusionCharts/FusionWidgets component to true. |
While creating charts from FusionCharts pack: |
<?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> |
For Flex 4 and with Spark components: |
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:components="com.fusioncharts.components.*"> <components:FusionCharts x="30" y="24" FCChartType="Column2D" FCDataURL="data.xml" FCDebugMode="true"/> </s:Application> |
While creating widgets from FusionWidgets pack: |
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.fusionwidgets.components.*"> <ns1:FusionWidgets x="30" y="24" FCChartType="AngularGauge" FCDataURL="data.xml" FCDebugMode="true"/> </mx:Application> |
For Flex 4 and with Spark components: |
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:components2="com.fusionwidgets.components.*"> <components2:FusionWidgets x="25" y="20" FCChartType="AngularGauge"/> </s: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 have 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 have been detected and are listed in the Debug Window. The debug mode is capable of detecting many more errors, which haven't been discussed yet. Examples: when you update your chart's data, all the transfer messages are logged so that they can be used to debug the application process. The debug mode will be of incredible help in speeding up your work. It will undoubtedly simplify your job - thereby making your life easy. |