FusionCharts Forum: FusionCharts.js - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

FusionCharts.js Getting "strDataXML.match is not a function" error.

#1 User is offline   Nalum 

  • Forum Newbie
  • Group: Members
  • Posts: 1
  • Joined: 21-May 09

Posted 21 May 2009 - 05:20 AM

Hello All,

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.
0

Other Replies To This Topic

#2 User is offline   saptarshi 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 357
  • Joined: 21-May 09

Posted 22 May 2009 - 05:17 AM

Hello,



Happy FusionCharting! :)
Regards,

Saptarshi Chakraborty



Follow us on Twitter!:w00t:
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic