Sign in to follow this  
Arindam

Please help me, I am not able to draw Line graph for the xml data

Recommended Posts

Following code is written on default.aspx

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml">

<

head runat="server">

<title>Untitled Page</title>

<link rel="stylesheet" href="style.css">

<script language="javascript" src="FusionCharts/FusionCharts.js">

function

draw()

{

}

</script>

</

head>

<

body>

<form id="form2" runat="server">

<div>

<table>

<tr>

<td align='center' class="table">

<div id="chart5Div">

This text is replaced by chart.

</div>

<%

=CreateChart()

%>

</td>

</tr>

</table>

</div>

</form>

</

body>

</

html>

===========================================

This code written in default.aspx.cs

protected void Page_Load(object sender, EventArgs e)

{

}

 

public string CreateChart()

{

string strXML = "<graph numdivlines='4' lineThickness='3' showValues='0' numVDivLines='10' ";

strXML += "formatNumberScale='1' rotateNames='1' decimalPrecision='1' anchorRadius='2'";

strXML += "anchorBgAlpha='0' numberPrefix='$' divLineAlpha='30'";

strXML += "showAlternateHGridColor='1' yAxisMinValue='800000' shadowAlpha='50' >";

strXML += "<categories ><category name='17379' /><category name='17410' /><category name='17440' />";

strXML += "<category name='17471' /><category name='17501' /><category name='17532' />";

strXML += "<category name='17563' /><category name='17592' /><category name='17623' />";

strXML += "<category name='17653' /><category name='17684' /><category name='17714' />";

strXML += "<category name='17745' /></categories>";

strXML += "<dataset seriesName='Current Year' color='A66EDD' anchorBorderColor='A66EDD' anchorRadius='4'>";

strXML += "<set value='301774889' /><set value='316452914' /><set value='323726174' />";

strXML += "<set value='332324660' /><set value='348478820' /><set value='358288941' />";

strXML += "<set value='356143694' /><set value='351111473' /><set value='351486340' />";

strXML += "<set value='352358131' /><set value='355765969' /><set value='359385228' />";

strXML += "<set value='364702230' /></dataset></graph>";

return

FusionCharts.RenderChart("../FusionCharts/FCF_MSLine.swf", "", strXML, "ChId1", "600", "350", false, false);

}

Thanks and regards,

Murughan

 

Share this post


Link to post
Share on other sites

Hi,

Could you please check relative path of FusionCharts.js and FCF_MSLine.swf are correct and also check FCF_MSLine.swf is present with in swf collection?

Revise this code

<script language="javascript" src="FusionCharts/FusionCharts.js">

function draw()

{

}

</script>

Change it to

 

<script language="javascript" src="FusionCharts/FusionCharts.js"></script>

Also check relative path of FusionCharts.js

Check swf file relative path

return FusionCharts.RenderChart("../FusionCharts/FCF_MSLine.swf", "", strXML, "ChId1", "600", "350", false, false);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this