Solved

Could you please correct my xml in Jquery chart data

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

734 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