Solved

Could you please correct my xml in Jquery chart data

Posted on 2013-02-05
3
340 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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.
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
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…

707 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

14 Experts available now in Live!

Get 1:1 Help Now