Solved

Could you please correct my xml in Jquery chart data

Posted on 2013-02-05
3
343 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
3 Comments
 
LVL 8

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
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)

820 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