Using Flash Debug Window |
Each Flash chart in PowerCharts XT provides a debug mode or debug window. It 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 for troubleshooting all your charts. The debug window lists errors like:
Important Note: Debug window is not available in JavaScript charts. In each chart, you can activate the debug mode by just enabling the debug flag. A typical debug window for a chart that rendered successfully using dataURL method, looks as under: Here, you can see a Spline 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. Initial Width: 500 Initial Height: 300 Scale Mode: noScale Debug Mode: Yes Application Message Language: EN Chart Type: Single Series 2D Spline Chart Version: 3.2.1 (XT) Chart Objects: BACKGROUND CANVAS CAPTION SUBCAPTION YAXISNAME XAXISNAME DIVLINES VDIVLINES YAXISVALUES HGRID VGRID DATALABELS DATAVALUES TRENDLINES TRENDVALUES DATAPLOT ANCHORS TOOLTIP VLINES VLINELABELS INFO: Chart registered with external script. DOM Id of chart is myChartId <chart caption="Weekly Sales Summary" showValues="0" xAxisName="Week" yAxisName="Sales" numberPrefix="$"><set label="Week 1" value="14400" /><set label="Week 2" value="19600" /><set label="Week 3" value="24000" /><set label="Week 4" value="15700" /></chart> |
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 debugMode flag to 1. If you're using FusionCharts JavaScript Class to render a chart, you can set the debugMode flag to 1 as under: <div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"><!-- var myChart = new FusionCharts("Spline.swf", "myChartId", "600", "300", "1"); myChart.setXMLUrl("Data.xml"); myChart.render("chartdiv"); // --> </script> See it live! The parameter after chart width and height is the debugMode flag. Set it to 1 and run the chart. You'll now see it with Debug Window. Use the debug window when building the chart. Once the chart runs fine, set the flag back to 0, so that your end users just see the chart and not the debug window. Note: Debug Mode error won't help you solve problems relating to path of chart SWF file, as the debug mode is a module inside the chart SWF file. So, unless the SWF file path is correct, you cannot switch debug mode on. If you're using direct HTML embedding mode, you can provide it as under: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="300" id="Column2D" > <param name="movie" value="../Charts/Spline.swf" /> Shown below are a few example errors shown in debug mode: |
Data URL and Data String missing |
In this chart, we have:
|
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' /> 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. PowerCharts XT 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 |
PowerCharts XT Debug Window can also capture the following errors in your Style definitions:
Let us 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' /> Here, we have the following errors in style XML:
When you run a chart against this XML, you will 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 have 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. |