I'm getting the following error "strDataXML.match is not a function" when I try to load xml using setDataXML()
The code I'm using to load the data is the following:
$.post('cloXML/clo_educationChart1.php',{
'ExaminationID':ExaminationID
}, function(data){
var chart1 = new FusionCharts("FusionCharts/FCF_MSBar2D.swf", "analysisChart1", "330", "334");
chart1.setDataXML(data);
chart1.render("analysisChart1");
},'xml');
The xml produced from this jQuery post is:
<?xml version="1.0" encoding="UTF-8"?>
<graph numdivlines='4' decimalPrecision='0' formatNumberScale='0' showBarShadow='0' showLegend='1'
yAxisMaxValue='100' divLineAlpha='0' canvasBorderThickness='0' canvasBgColor='EFEFEF'
canvasBorderColor='EFEFEF' bgColor='EFEFEF' >
<categories>
<category name='C1' />
<category name='C2' />
<category name='C3' />
<category name='C4' />
<category name='C5' />
<category name='C6' />
</categories>
<dataset seriesname='Your Score' color='E479A5' showValues='0'>
<set value='63' />
<set value='40' />
<set value='46' />
<set value='41' />
<set value='32' />
<set value='32' />
</dataset>
<dataset seriesname='Industry Average' color='cccccc' showValues='0'>
<set value='76' />
<set value='47' />
<set value='49' />
<set value='45' />
<set value='41' />
<set value='34' />
</dataset>
</graph>
Any help would be greatly appreciated.
Regards,
Nalum
##################################
EDIT: I've fixed the problem.
When using $.post(); set the content type to text rather than xml as Fusion Charts is expecting a string.

Back to top
MultiQuote