Venkat1269

How To Create Gantt Chart By Using Xml In Jsp

Recommended Posts

Hi,

 

I'm new to Fusion charts. I got one requirement to genarate Gantt fusion chart on the JSP by using FusionChart.js.

 

I have created JSP and copied Gantt.swf and FusionCharts.js file in web-inf directory.

 

Please find the attached xmlData file for the xml data. This is example chart i found in the fusion web site.

 

When i run this program its not displaying the chart. Could you please let me know what is wrong wit my code and also let me know how can i generate sucessfully Gantt chart by using the attached xmlData.

 

Thanks in Advance.

JSP File :-

 

<html>

<head>

<head>

<title>Example Graph</title>

<SCRIPT lang="Javascript" src="FusionCharts/FusionCharts.js"></SCRIPT>

</head>

<%

String xmlData = "";

%>

<body>

<%if(xmlData != null && xmlData.length() > 0) {%>

<table width="98%" align="center" cellpadding="2" cellspacing="0">

<tr>

<td align="center">

<div id="chartdiv" align="center">Milestone Chart</div>

<script type="text/javascript">

var myChart = new FusionCharts("FusionCharts/Gantt.swf", "milestoneChart", "800", "600", "0", "0");

myChart.setDataXML("<%=xmlData%>");

myChart.render("chartdiv");

</script>

</td>

</tr>

</table>

<%}%>

<br>

<!-- BEGIN messages -->

 

</body>

</html>

 

xmlData.txt

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi Venkat,

 

A warm welcome to the FusionCharts Forum :)

 

Please try using the setXMLData() method instead of setDataXML method.

 

Also, please find attached sample demo.

 

Hope this helps!

GanttChart.zip

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