Hint: double quotes != single quote apostrophes for the setDataXML string
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Hint: double quotes != single quote... Expand / Collapse
Author
Message
Posted 2/27/2008 10:23:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/27/2008 10:18:17 AM
Posts: 1, Visits: 1
Hi,
Thanks for a great software.

I had an annoying 'invalid XML' error for a few hours when trying to
script graphs that worked perfectly from static files.

The solution was to only use single quotes for all attributes within
the xml and always using double quotes to handle the string in the javascript.
The other way around does not work.

Best regards
Patrik Carlsson
Post #4747
Posted 2/28/2008 12:16:55 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 10/5/2008 9:41:33 AM
Posts: 809, Visits: 1,285
hi,

For DoubleQuote fixes we have another version of beta FusionCharts.js which you can try from http://www.fusioncharts.com/forum/FindPost4757.aspx

Regards,

Sudipto Choudhury
FusionCharts Team

Post #4758
Posted 3/6/2008 9:12:56 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/6/2008 8:54:07 PM
Posts: 1, Visits: 4
I had similar frustrations with scripted charts - no issues w/ quotes, but having similar invalid XML data messages.  I have a workaround for it, but I'm posting to see if it's a bug or something else.

I'm establishing my xml data as a js variable, and passing the variable name to the setDataXML method.  Kept getting "Invalid XML Data" in the chart, so I added an updateChartXML call after the render, using the same variable data, and now I get a chart to display.  Here's an excerpt of the HTML being generated:

<div id="chartloc1">--- Chart Goes Here ---</div><br>
<script type=text/javascript>
var chart1 = new FusionCharts("/fusioncharts/charts/FCF_Pie3D.swf", "Chart1Id", "600", "250", "0","1");
var chartdata1="<graph caption='Distribution by Account' bgColor='F1F1F1' showNames='1' numberPrefix='$' pieSliceDepth='15' pieYScale='40' pieFillAlpha='100' decimalPrecision='0'><set name='ACCOUNT 1' value='12000' color='0000CC'/><set name='ACCOUNT 2' value='3900' color='FF3333'/><set name='ACCOUNT 3' value='36' color='6666CC'/><set name='ACCOUNT 4' value='-35' color='CC0066'/></graph>";
chart1.setDataXML(chartdata1);
chart1.render("chartloc1");
updateChartXML("Chart1ID",chartdata1);
</script>

It's an extra step, but it works.  Is there something else that I'm missing?

Also echoing the great product statement - addresses a wide variety of potential needs for me.

Post #4987
Posted 3/6/2008 11:23:13 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 10/5/2008 9:41:33 AM
Posts: 809, Visits: 1,285
hi,

Your code without 'updateChartXML("Chart1ID",chartdata1);' works fine in our labs and the chart renders well.


Regards,

Sudipto Choudhury
FusionCharts Team

Post #4988
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 4:16pm


Execution: 0.141.