anantvirdee

Gantt chart not displaying

Recommended Posts

I wanted to create a gantt chart using fusion charts. The chart doesn't get rendered a element is created, with Chart type not supported as text. Using the fusion chart debugger I get an Error that p.init is not a function in fusioncharts.js This is the code for the gantt chart.

 

<html xmlns="http://www.w3.org/1999/html">
<head>
<title>Weekly Project Status Reports</title>
<script type="text/javascript" src="fusioncharts/fusioncharts.js"></script>
<script type="text/javascript" src="fusioncharts/fusioncharts.gantt.js"></script>
<script type="text/javascript" src="fusioncharts/fusioncharts.widgets.js"></script>
<script type="text/javascript" src="fusioncharts/themes/fusioncharts.theme.fint.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
FusionCharts['debugger'].outputTo(function (id, sender,
eventName, eventArgs) {
console.log(id + ': '+eventName + ' from ' + sender+','+eventArgs);
});
FusionCharts['debugger'].outputFormat('verbose');
FusionCharts['debugger'].enable(true);
</script>
<script type="text/javascript">

FusionCharts.ready(function(){
var weeklyStatusChart = new FusionCharts({
"type": "gantt",
"renderAt": "chartContainer",
"width": "1000",
"height": "500",
"dataFormat": "json",
"dataSource": {
"chart": {
"dateformat": "mm/dd/yyyy",
"caption": "Project Gantt",
"subcaption": "From 1st Feb 2007 - 31st Aug 2007"
},
"categories": [
{
"category": [
{
"start": "02/01/2007",
"end": "03/01/2007",
"label": "Feb"
},
{
"start": "03/01/2007",
"end": "04/01/2007",
"label": "Mar"
}
]
}
],
"processes": {
"fontsize": "12",
"isbold": "1",
"align": "right",
"process": [
{
"label": "Identify Customers"
},
{
"label": "Survey 50 Customers"
}
]
},
"tasks": {
"task": [
{
"start": "02/04/2007",
"end": "02/10/2007"
},
{
"start": "02/08/2007",
"end": "02/19/2007"
}
]
}
}
})
weeklyStatusChart.render();

});
</script>
</head>
<body>
<div id="chartContainer">--- Weekly Project Status</div>
</body>
</html>

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum.

 

You can render your chart by including the 'fusioncharts.gantt.js' file after 'fusioncharts.widgets.js'.

 

Also, the gantt chart can be rendered by including only the 'fusioncharts.js' file. Since this file will internally load the other required files.

 

Hop this helps. 

Share this post


Link to post
Share on other sites

Hi, 

 

I need help to resolv a problem during generation Gantt chart.

 

this is the XML code:

{<chart dateformat='mm/dd/yyyy' outputdateformat='hh:mn' caption='Planejamento Laser' subcaption='De 30/05/2016 à 06/06/2016' showborder='0'>
<categories>
<category start='30/05/2016 00:00:00' end='30/05/2016 23:59:59' label='30/05/2016' />
<category start='31/05/2016 00:00:00' end='31/05/2016 23:59:59' label='31/05/2016' />
<category start='01/06/2016 00:00:00' end='01/06/2016 23:59:59' label='01/06/2016' />
<category start='02/06/2016 00:00:00' end='02/06/2016 23:59:59' label='02/06/2016' />
<category start='03/06/2016 00:00:00' end='03/06/2016 23:59:59' label='03/06/2016' />
<category start='04/06/2016 00:00:00' end='04/06/2016 23:59:59' label='04/06/2016' />
<category start='05/06/2016 00:00:00' end='05/06/2016 23:59:59' label='05/06/2016' />
</categories>
<categories align='center'>
<category start='30/05/2016 00:00:00' end='30/05/2016 05:59:59' label='0 - 6' />
<category start='30/05/2016 06:00:00' end='30/05/2016 11:59:59' label='6 - 12' />
<category start='30/05/2016 12:00:00' end='30/05/2016 17:59:59' label='12 - 18' />
<category start='30/05/2016 18:00:00' end='30/05/2016 23:59:59' label='18 - 0' />
<category start='31/05/2016 00:00:00' end='31/05/2016 05:59:59' label='0 - 6' />
<category start='31/05/2016 06:00:00' end='31/05/2016 11:59:59' label='6 - 12' />
<category start='31/05/2016 12:00:00' end='31/05/2016 17:59:59' label='12 - 18' />
<category start='31/05/2016 18:00:00' end='31/05/2016 23:59:59' label='18 - 0' />
<category start='01/06/2016 00:00:00' end='01/06/2016 05:59:59' label='0 - 6' />
<category start='01/06/2016 06:00:00' end='01/06/2016 11:59:59' label='6 - 12' />
<category start='01/06/2016 12:00:00' end='01/06/2016 17:59:59' label='12 - 18' />
<category start='01/06/2016 18:00:00' end='01/06/2016 23:59:59' label='18 - 0' />
<category start='02/06/2016 00:00:00' end='02/06/2016 05:59:59' label='0 - 6' />
<category start='02/06/2016 06:00:00' end='02/06/2016 11:59:59' label='6 - 12' />
<category start='02/06/2016 12:00:00' end='02/06/2016 17:59:59' label='12 - 18' />
<category start='02/06/2016 18:00:00' end='02/06/2016 23:59:59' label='18 - 0' />
<category start='03/06/2016 00:00:00' end='03/06/2016 05:59:59' label='0 - 6' />
<category start='03/06/2016 06:00:00' end='03/06/2016 11:59:59' label='6 - 12' />
<category start='03/06/2016 12:00:00' end='03/06/2016 17:59:59' label='12 - 18' />
<category start='03/06/2016 18:00:00' end='03/06/2016 23:59:59' label='18 - 0' />
<category start='04/06/2016 00:00:00' end='04/06/2016 05:59:59' label='0 - 6' />
<category start='04/06/2016 06:00:00' end='04/06/2016 11:59:59' label='6 - 12' />
<category start='04/06/2016 12:00:00' end='04/06/2016 17:59:59' label='12 - 18' />
<category start='04/06/2016 18:00:00' end='04/06/2016 23:59:59' label='18 - 0' />
<category start='05/06/2016 00:00:00' end='05/06/2016 05:59:59' label='0 - 6' />
<category start='05/06/2016 06:00:00' end='05/06/2016 11:59:59' label='6 - 12' />
<category start='05/06/2016 12:00:00' end='05/06/2016 17:59:59' label='12 - 18' />
<category start='05/06/2016 18:00:00' end='05/06/2016 23:59:59' label='18 - 0' />
</categories>
<processes fontsize='12' isbold='1' align='left' headertext='Laser' headerfontsize='18' headervalign='bottom' headeralign='left'>
<process label='Laser 1' id='LASER 1' />
<process label='Laser 2' id='LASER 2' />
</processes>
<tasks showlabels='1' showstartdate='1'>
<task processid='LASER 1' start='30/05/2016 06:30' end='30/05/2016 10:30' label='TRACK1 E RIB 42' />
<task processid='LASER 1' start='01/06/2016 06:30' end='01/06/2016 15:30' label='TREINAMENTO (INFIELD CALL PROBE API) EXTERNO NA API.' />
<task processid='LASER 1' start='02/06/2016 06:30' end='02/06/2016 11:30' label='TREINAMENTO (INFIELD CALL PROBE API) EXTERNO NA API.' />
</tasks> 
</chart> }

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