Solved

Could you please correct my xml in Jquery chart data

Posted on 2013-02-05
3
342 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
Question by:stmani2005
3 Comments
 
LVL 8

Author Comment

by:stmani2005
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now