Solved

Could you please correct my xml in Jquery chart data

Posted on 2013-02-05
3
345 Views
Last Modified: 2013-02-11
var XMLData = "<chart caption='TPO_Region' showBorder='1' imageSave='1' imageSaveURL='http://www.fusioncharts.com/ExportHandlers/PHP/_FCExporter.php'><set label='500711' value='1500'link='newchart-xml-2009Quarters'/><set label='500712' value='3000'link='newchart-xml-2009Quarters'/><set label='500713' value='4500'link='newchart-xml-2009Quarters'/><set label='500714' value='6000'link='newchart-xml-2009Quarters'/><set label='500715' value='7500'link='newchart-xml-2009Quarters'/><set label='500716' value='9000'link='newchart-xml-2009Quarters'/><linkeddata id='2009Quarters'><chart caption='Second level region'    useRoundEdges='1' bgColor='FFFFFF,FFFFFF' showBorder='0'><set label='Q1' value='1000'link='newchart-xml-2009Month'/><set label='Q2' value='2000'link='newchart-xml-2009Month'/><set label='Q3' value='3000'link='newchart-xml-2009Month'/><set label='Q4' value='4000'link='newchart-xml-2009Month'/><linkeddata id='2009Month'><chart caption='Monthly Sales Summary' subcaption='For the first quarter of year 2009' AxisName='Month' yAxisName='Sales' numberPrefix='$' showValues='0' useRoundEdges='1' ><set label='January' value='1100' /><set label='February' value='760' /><set label='March' value='880' /></chart></linkeddata></chart>"
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Author Comment

by:Manikandan Thiagarajan
ID: 38854737
it shows invalid data in graph
0
 
LVL 13

Expert Comment

by:stergium
ID: 38854760
Hello.
I am probably missunderstood on what you need.
var XMLData1 = [
{label:'500711', value:1500,link:'newchart-xml-2009Quarters'},
{label:'500712' value:3000link:'newchart-xml-2009Quarters'},
{label:'500713' value:4500,link:'newchart-xml-2009Quarters'},
{label:'500714' value:6000,link:'newchart-xml-2009Quarters'},
{label:'500715' value:7500,link:'newchart-xml-2009Quarters'},
{label:'500716' value:9000,link:'newchart-xml-2009Quarters'}
];
//other chart data
var XMLData2 = [
{label:'Q1', value:1000,link:'newchart-xml-2009Month'},
{label:'Q2', value:2000,link:'newchart-xml-2009Month'},
{label:'Q3', value:3000,link:'newchart-xml-2009Month'},
{label:'Q4', value:4000,link:'newchart-xml-2009Month'}
];
//other chart data
var XMLData3 = [
{label:'January', value:1100 },
{label:'February', value:760},
{label:'March', value:880 }
];

Open in new window

0
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38855219
Your XML was not 'well formed'.  You were missing a few closing tags.

I added the tags and ran it through an xml validator and it passed for being well formed, here is the new XML:
<chart caption='TPO_Region' showBorder='1' imageSave='1' imageSaveURL='http://www.fusioncharts.com/ExportHandlers/PHP/_FCExporter.php'>
  <set label='500711' value='1500' link='newchart-xml-2009Quarters'/>
  <set label='500712' value='3000' link='newchart-xml-2009Quarters'/>
  <set label='500713' value='4500' link='newchart-xml-2009Quarters'/>
  <set label='500714' value='6000' link='newchart-xml-2009Quarters'/>
  <set label='500715' value='7500' link='newchart-xml-2009Quarters'/>
  <set label='500716' value='9000' link='newchart-xml-2009Quarters'/>
  <linkeddata id='2009Quarters'>
    <chart caption='Second level region' useRoundEdges='1' bgColor='FFFFFF,FFFFFF' showBorder='0'>
      <set label='Q1' value='1000' link='newchart-xml-2009Month'/>
      <set label='Q2' value='2000' link='newchart-xml-2009Month'/>
      <set label='Q3' value='3000' link='newchart-xml-2009Month'/>
      <set label='Q4' value='4000' link='newchart-xml-2009Month'/>
      <linkeddata id='2009Month'>
        <chart caption='Monthly Sales Summary' subcaption='For the first quarter of year 2009' AxisName='Month' yAxisName='Sales' numberPrefix='$' showValues='0' useRoundEdges='1' >
          <set label='January' value='1100' /><set label='February' value='760' />
          <set label='March' value='880' />
        </chart>
      </linkeddata>
    </chart>
 </linkeddata>
</chart>

Open in new window

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question