Hi All,
I am geting data from database as
Year Month Series name Values
2008 7 CARDIAC 100
2008 7 DU- IT 100
2008 7 MULTIVENDOR 100
2008 8 CARDIAC 100
2008 8 DU- IT 67
2008 8 P-TECH 100
2008 9 CARDIAC 100
2008 9 DU- IT 67
2008 9 NETWORKING 0
2008 9 P-TECH 100
2008 10 CARDIAC 100
2008 10 DU- IT 100
2008 10 MULTIVENDOR 100
2008 10 NETWORKING 50
2008 10 P-TECH 100
2008 11 CARDIAC 100
2008 11 DU- IT 100
2008 11 MULTIVENDOR 100
2008 12 CARDIAC 67
2008 12 DU- IT 100
2008 12 MULTIVENDOR 50
2008 12 P-TECH 100
2009 3 CARDIAC 100
2009 3 DU- IT 100
2009 3 MULTIVENDOR 100
2009 3 NETWORKING -100
2009 3 P-TECH 100
2009 6 CARDIAC 50
2009 6 DU- IT 100
2009 6 MULTIVENDOR 100
now i have to generate xml,for preparing fusion cahrt.because fusion chart accepts data in xml format.
I am getting xml file like this.
<chart connectNullData='1' labelDisplay='Rotate' slantLabels='1' baseFont='Ge Inspira' useRoundEdges='1' legendPosition='RIGHT' imageSave='1' link='javaScript:onClick()' yAxisName='Values' legendBorderAlpha='0' shownames='1' showvalues='0' ><categories><category label='Jul-2008'/><category label='Aug-2008'/><category label='Sep-2008'/><category label='Oct-2008'/><category label='Nov-2008'/><category label='Dec-2008'/><category label='Mar-2009'/><category label='Jun-2009'/></categories><dataset seriesName='P-TECH'><set value='0.0'/><set value='100.0'/><set value='100.0'/></dataset><dataset seriesName='CARDIAC'><set value='100.0'/><set value='0.0'/><set value='75.0'/><set value='0.0'/><set value='100.0'/><set value='100.0'/><set value='33.0'/></dataset><dataset seriesName='MULTIVENDOR'><set value='0.0'/><set value='0.0'/><set value='100.0'/><set value='75.0'/><set value='100.0'/><set value='50.0'/></dataset><dataset seriesName='NETWORKING'><set value='0.0'/><set value='100.0'/><set value='100.0'/></dataset><dataset seriesName='DU- IT'><set value='100.0'/><set value='100.0'/><set value='100.0'/><set value='75.0'/><set value='100.0'/><set value='100.0'/><set value='50.0'/><set value='100.0'/></dataset></chart>I am trying to plot msline chart using msline.swf file in
jsp.
but my problem is
i have several months as categorie labels.
in database for dataset p-tech,i have values according to month dec-2008,mar-2009,apr-2009.
but it is ploating on jul-2008,aug-2008,sep-2008 respectivley.
The reason is.....
Just to reiterate, i am passing category labels as follows:
<category label='Jul-2008'/>
<category label='Aug-2008'/>
<category label='Sep-2008'/>
<category label='Oct-2008'/>
<category label='Nov-2008'/>
<category label='Dec-2008'/>
<category label='Mar-2009'/>
<category label='Jun-2009'/>
Now, for example, when i am passing the data values for the series "P-Tech", i m passing the set values, which, i assume are to correspond to the categories of Dec, Mar and Jun, is as follows:
<set value='0.0'/>
<set value='100.0'/>
<set value='100.0'/>
Here, what is happening is that the <set> elements given as input are three in number and thereby they are corresponding to the first three categories in the category list which are that of Jul, Aug and Sep.
Here, we need to pass empty <set> elements so that the values, say in the "P-Tech" series, refer/correspond to the correct category label.
Foe example:
<chart ....... >
<categories>
<category label='Jul-2008'/>
<category label='Aug-2008'/>
<category label='Sep-2008'/>
<category label='Oct-2008'/>
<category label='Nov-2008'/>
<category label='Dec-2008'/>
<category label='Mar-2009'/>
<category label='Jun-2009'/>
</categories>
<dataset seriesName='P-TECH'>
<set />
<set />
<set />
<set />
<set />
<set value='0.0'/>
<set value='100.0'/>
<set value='100.0'/>
</dataset>
..
..
..
<chart/>
How to create empty set tags at coresponding positions.
I have each column values in one bean with database order.
Let me know any suggestions to do this.
Thanks,
Anila....