renukasagani

Stackedbar2D Invalid Xml

Recommended Posts

HI,

 

Iam using Fusioncharts-V-3.2.1 .Actually my code working with flash, but I am using javascript render method with "FusionCharts.setCurrentRenderer('javascript');" , in this it is not working . Giving xml error like "Error in loading data / invalid xml".

 

Below is my code :

<script language="JavaScript" src="../../Charts/FusionCharts.js"></script>

 

XML Code

 

<chart bgColor='E9E9E9' outCnvBaseFontColor='666666' caption='Monthly Sales Summary Comparison' xAxisName='Month' yAxisName='Sales' numberPrefix='$' showValues='0'

numVDivLines='10' showAlternateVGridColor='1' AlternateVGridColor='e1f5ff' divLineColor='e1f5ff' vdivLineColor='e1f5ff' baseFontColor='666666'

toolTipBgColor='F3F3F3' toolTipBorderColor='666666' canvasBorderColor='666666' canvasBorderThickness='1' showPlotBorder='1' plotFillAlpha='80'>

<categories>

<category label='Jan' />

<category label='Feb' />

<category label='Mar' />

<category label='Apr' />

<category label='May' />

<category label='Jun' />

<category label='Jul' />

<category label='Aug' />

<category label='Sep' />

<category label='Oct' />

<category label='Nov' />

<category label='Dec' />

</categories>

<dataset seriesName='2004' color='B1D1DC' plotBorderColor='B1D1DC'>

<set value='27400' />

<set value='29800'/>

<set value='25800' />

<set value='26800' />

<set value='29600' />

<set value='32600' />

<set value='31800' />

<set value='36700' />

<set value='29700' />

<set value='31900' />

<set value='32900' />

<set value='34800' />

</dataset>

<dataset seriesName='2003' color='C8A1D1' plotBorderColor='C8A1D1'>

<set />

<set />

<set value='4500'/>

<set value='6500'/>

<set value='7600' />

<set value='6800' />

<set value='11800' />

<set value='19700' />

<set value='21700' />

<set value='21900' />

<set value='22900' />

<set value='29800' />

</dataset>

<trendlines>

<line startValue='22000' endValue='58000' color='999999' displayValue='Target' dashed='1' thickness='2' dashGap='6' alpha='100' showOnTop='1'/>

</trendlines>

<styles>

<definition>

<style type='animation' name='TrendAnim' param='_alpha' duration='1' start='0' />

</definition>

<application>

<apply toObject='TRENDLINES' styles='TrendAnim' />

</application>

</styles>

</chart>

 

<div id="chartdiv" align="center">

FusionCharts. </div>

<script type="text/javascript">

FusionCharts.setCurrentRenderer('javascript');

var chart = new FusionCharts("../../Charts/StackedBar2D.swf", "ChartId", "560", "400", "0", "0");

chart.setXMLUrl("../Data/XML/StBar2D1.xml");

chart.render("chartdiv");

</script>

 

Please give me any suggestions to resolve this issue as early as possible.

 

Thanks,

Edited by renukasagani

Share this post


Link to post
Share on other sites

Are you running this locally. If yes, try running your codes from server and check. By "locally" I meant, direct from file using the "file://" protocol.

 

The premise being: if you are providing data URL as "file://" protocol, the browser security restrictions on AJAX prevent it from being able to load data. Different browsers have different security policy on this. For example, in FireFox, you can fetch data provided the file is in the same folder as the HTML file from where it is being called.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now