Click here to Skip to main content
15,883,751 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more: , +
Hi guys,

i was working on fusion chart, using c# n fetching data from sql server2008.

creating xml, rendering chart. But getting 'invalid xml data'.

asp.net:

XML
<div id="chartContainerCT" runat="server" style="text-align:center">
                              <asp:Literal ID="Literal1" runat="server">FusionCharts will load here!</asp:Literal>
                          </div>



c#:

C#
string xmlcode = CreateChart(fromdt, todt, sec);

Literal1.Text = FusionCharts.RenderChartHTML("chart/FusionChart/Charts/StackedColumn3D.swf", "", xmlcode, chartContainerCT.ClientID, "470", "300", false);


xml:

the above xmlcode will get this xml:

XML
<graph caption='NPS' palette='1' animation='1' formatNumberScale='0' startingAngle='125' baseFontSize='15' baseFontBold='1'' rotateNames='1' >
<categories>
<category label='40-311' UnitID='1' />
<category label='40-312' UnitID='2' />
<category label='40-313' UnitID='3' />
<category label='40-314' UnitID='4' />
<category label='40-315' UnitID='5' />
<category label='40-316' UnitID='6' />
<category label='40-317-SV 607' UnitID='7' />
<category label='40-318' UnitID='8' />
<category label='40-319-SV 609' UnitID='9' />
<category label='40-322' UnitID='12' />
<category label='40-324' UnitID='71' />
<category label='40-325' UnitID='72' />
<category label='45-319' UnitID='10' />
<category label='45-320' UnitID='11' />
</categories>

<dataset seriesName='Active' >
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=2&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=4&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=5&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=7&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=9&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=12&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=71&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=72&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=10&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=11&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=1&label=label' />
<set value=' ' color='#FF0000' />
</dataset>
<dataset seriesName='InActive' >
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=1&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=2&label=label' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=3&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=2&label=label' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=6&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=2&label=label' />
<set value=' ' color='#FF0000' />
<set value='1' color='#00FF00' link='P-detailsPopUp,width=800,height=550,toolbar=no,scrollbars=no,resizable=no-EquipmentInActive.aspx?EquipmentID=8&Section=1&StartDate=05/25/2014&EndDate=05/25/2014&Status=2&label=label' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
<set value=' ' color='#FF0000' />
</dataset>
</graph>


Can any one plzz....help me.

thanks
Posted
Updated 7-Jun-14 20:09pm
v7
Comments
karthik Udhayakumar 7-Jun-14 12:23pm    
What is the error message abdul?
abdul subhan mohammed 7-Jun-14 12:26pm    
invalid xml data
Dusara Maulik 9-Jun-14 8:16am    
Data is not available for every categories.

1 solution

Hi,

Use FusionChart v3 XML Generator Utility[^] to compare your XML with generated XML
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900