Jaweds Report post Posted September 6, 2011 (edited) Hi All, I am using power charts of fusion chart and am creating a multi-axis line chart. The code is working file if I am getting the data from a link but if I am getting the data through setXMLData then I am getting a error 'invalid data'. The code is given below. var myChart = new FusionCharts( "../../Charts/MultiAxisLine.swf", "myChartId", "750", "450", "0", "1" ); myChart.setXMLData("<chart caption='Power Generator' xAxisName='Time' showValues='0' divLineAlpha='100' numVDivLines='4' vDivLineAlpha='0' showAlternateVGridColor='1' alternateVGridAlpha='5'><categories><category label='00:00s' /><category label='00:04s' /><category label='00:08s' /><category label='00:12s'> <category label='00:16s' /><category label='00:20s' /></categories><axis title='Power' titlePos='left' tickWidth='10' divlineisdashed='1'><dataset seriesName='Power [W]' ><set value='6' /><set value='26' /> <set value='16' /><set value='27' /><set value='28' /><set value='33'/></dataset></axis><axistitle='Temp.' titlePos='left' numDivLines='14' tickWidth='10' divlineisdashed='1' ><dataset seriesName='Temperature'> <set value='296' /><set value='311' /><set value='336' /><set value='371' /><set value='389' /><set value='393' /></dataset> </axis><axis title='Speed[RPM]' titlepos='RIGHT' axisOnLeft='0' numDivLines='10' tickWidth='10' divlineisdashed='1'><dataset seriesName='Speed'><set value='1' /><set value='11' /><set value='36' /><set value='49' /><set value='68' /><set value='88' /></dataset></axis></chart>"); myChart.render( "chartContainer" ); The xml data is of fusion chart example data. Any help will be appreciated. Thanks jawed Edited September 6, 2011 by Jaweds Share this post Link to post Share on other sites
Guest Angshu Report post Posted September 6, 2011 Hi, Welcome to FusionCharts Forum! Please find the modified code below: var myChart = new FusionCharts( "../../Charts/MultiAxisLine.swf", "myChartId", "750", "450", "0", "1" ); myChart.setXMLData("<chart caption='Power Generator' xAxisName='Time' showValues='0' divLineAlpha='100' numVDivLines='4' vDivLineAlpha='0' showAlternateVGridColor='1' alternateVGridAlpha='5'><categories><category label='00:00s' /><category label='00:04s' /><category label='00:08s' /><category label='00:12s' /> <category label='00:16s' /><category label='00:20s' /></categories><axis title='Power' titlePos='left' tickWidth='10' divlineisdashed='1'><dataset seriesName='Power [W]' ><set value='6' /><set value='26' /> <set value='16' /><set value='27' /><set value='28' /><set value='33'/></dataset></axis><axistitle='Temp.' titlePos='left' numDivLines='14' tickWidth='10' divlineisdashed='1' ><dataset seriesName='Temperature'> <set value='296' /><set value='311' /><set value='336' /><set value='371' /><set value='389' /><set value='393' /></dataset> </axis><axis title='Speed[RPM]' titlepos='RIGHT' axisOnLeft='0' numDivLines='10' tickWidth='10' divlineisdashed='1'><dataset seriesName='Speed'><set value='1' /><set value='11' /><set value='36' /><set value='49' /><set value='68' /><set value='88' /></dataset></axis></chart>"); myChart.render( "chartContainer" ); Please find the screenshot attached for your reference. Hope this helps. Share this post Link to post Share on other sites
Jaweds Report post Posted September 6, 2011 Thanks for your help. What was the error ??? Can you please let me know. And your resolved code has two parameters, was the problem due to 3 parameters. I have a requirement where the y axis parameter can me more 5 or 6 you can say. Please help me out. Thanks again. Jawed Share this post Link to post Share on other sites
Guest Angshu Report post Posted September 6, 2011 Hi, Thanks for your response. <category label='00:12s' /> - Here the closing tag (/) was missing. If you get an "Invalid XML Data" message, it means that the XML data document is malformed. For more details, please visit the link: http://www.fusioncharts.com/docs/?Debug/Basic.html Hope this helps. Share this post Link to post Share on other sites