Sign in to follow this  
jarnsura

Php And Gantt Simple

Recommended Posts

Hello,

 

Please help me to start up. I am trying to create simple Gantt chart. I only get the bar without any labels. I noticed someone else had same problem and resolved, but no any solution was described :blink: .

 

Here is the code and attached result.

 

<?php

include("../Includes/FusionCharts.php");

?>

<HTML>

<HEAD>

<TITLE>Simple Gantt Chart</TITLE>

</HEAD>

<BODY>

<?php

 

$strXML .="<chart dateFormat='dd/mm/yyyy' caption='Project Gantt' subCaption='From 1st Feb 2007 - 31st Aug 2007'>";

$strXML .="<categories bgColor='ffffff' fontColor='1288dd' fontSize='10' isBold='1' align='center'>";

$strXML .="<category start='01/02/2007' end='01/03/2007' label='Feb'/>";

$strXML .="</categories>";

$strXML .="<processes fontSize='12' isBold='1' align='right'>";

$strXML .="<process label='Identify Customers'/>";

$strXML .="</processes>";

$strXML .="<tasks>";

$strXML .="<task start='04/02/2007' end='10/02/2007'/>";

$strXML .="</tasks>";

$strXML .="</chart>";

 

echo renderChartHTML("../Charts/FCF_Gantt.swf", "", $strXML, "myFirst", 600, 300);

?>

</BODY>

</HTML>

post-33679-0-14640900-1355215490_thumb.jpg

Edited by jarnsura

Share this post


Link to post
Share on other sites

Hey,

 

FusionCharts Free does not support label attribute. You would need replace the "label" attribute with "name" attribute to display the labels.

 

<category start='01/02/2007' end='01/03/2007' name='Feb'/>
....
<process name='Identify Customers'/>

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hello,

 

 

Ok, code was copied from sample and it does not work in free Fusionchart. I bought the license and now it works!

Attribute change worked also for names.

 

Thank you.

Share this post


Link to post
Share on other sites

Now everything for the Gantt chart seems working fine. I bought the FusionWidgets Personal XT package. I am now trying to do the DrillDown. Should I be able to do this, or am I missing something? Please help me.

 

Below some xml data, drilldown is from example:

...

<processes bgColor='ffffff' fontSize='10' isBold='1' align='center' headertext='TilNro/Pos'>

<process label='11255/801' id='11255/801' link='newchart-xml-11255/801'/>

<linkeddata id='11255/801'>

<chart caption='Testing' subcaption='Click on a column to drill-down' xAxisName='Quarter' yAxisName='Sales' numberPrefix=' showValues='0' useRoundEdges='1'>

<set label='Q1' value='2740'/>

<set label='Q2' value='2700'/>

<set label='Q3' value='3180'/>

<set label='Q4' value='2990'/>

</chart>

</linkeddata>

</processes>

...

 

 

I also attached the picture of total project. I would like to drilldown from left column lines and open new gantt chart.

post-33679-0-98300900-1357386490_thumb.jpg

Edited by jarnsura

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

It seems from the "Code snippet for drill down Gantt chart", in the <linkeddata></linkeddata> element, you have the chart XML which is not in the Gantt chart XML format.

 

So, could you please correct the drilled down Gantt chart XML (inside <linkeddata> element) and place it just before closing the </chart> tag and try once again?

 

Ref. XML Code for Drill Down Gantt Chart:

<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"/>
<category start="03/01/2007" end="04/01/2007" label="Mar"/>
 </categories>
<processes bgColor='ffffff' fontSize='10' isBold='1' align='center' headertext='TilNro/Pos'>
  <process label='11255/801' id='11255/801' link='newchart-xml-11255/801'/>
 </processes>
 <tasks>
<task start="02/04/2007" end="02/10/2007"/>
<task start="02/08/2007" end="02/19/2007"/>
 </tasks>
  <linkeddata  id='11255/801'>
  <chart>
<categories>
	<category start="02/01/2007" end="03/01/2007" label="Feb"/>
</categories>
<processes fontSize="12" isBold="1" align="right">
	<process label="Identify Customers"/>
</processes>
<tasks>
	<task start="02/04/2007" end="02/10/2007"/>
</tasks>
</chart>
 </linkeddata>
</chart>

 

Hope this helps!

Share this post


Link to post
Share on other sites

Thank you for reply. I have now tried to create simply drilldown gantt chart. Yes, I also figured it out after posting the problem that I should be using same Gantt chart format where drilldown is called from.

 

I tried the code you proposed and still having the same problem. No alarms and with button nothing happens. Cursor shows a link is available.

 

Below the total PHP code. Any ideas what is wrong? Please help.

 

 

 

 

<?php

//We've included ../Includes/FusionCharts.php, which contains functions

//to help us easily embed the charts.

include("../Includes/FusionCharts.php");

 

?>

<HTML>

<HEAD>

<TITLE>TESTING_GANTT</TITLE>

</HEAD>

<BODY>

<?php

 

$strXML .="<chart dateFormat='mm/dd/yyyy' caption='Project Gantt' subCaption='From 1st Feb 2007 - 31st Aug 2007'>";

$strXML .="<categories'>";

$strXML .="<category start='02/01/2007' end='03/01/2007' label='Feb'/>";

$strXML .="<category start='03/01/2007' end='04/01/2007' label='Mar'/>";

$strXML .="</categories>";

$strXML .="<processes fontSize='12' isBold='1' align='right' headertext='TilNro/Pos'>";

$strXML .="<process label='11255/801' id='11255/801' link='newchart-xml-11255/801'/>";

$strXML .="</processes>";

$strXML .="<tasks>";

$strXML .="<task start='02/04/2007' end='02/10/2007'/>";

$strXML .="<task start='02/15/2007' end='02/19/2007'/>";

$strXML .="</tasks>";

$strXML .="<linkeddata id='11255/801'>";

$strXML .="<chart>";

$strXML .="<categories>";

$strXML .="<category start='02/01/2007' end='03/01/2007' label='Feb'/>";

$strXML .="</categories>";

$strXML .="<processes fontSize='12' isBold='1' align='right'>";

$strXML .="<process label='Identify Customers'/>";

$strXML .="</processes>";

$strXML .="<tasks>";

$strXML .="<task start='02/04/2007' end='02/10/2007'/>";

$strXML .="</tasks>";

$strXML .="</chart>";

$strXML .="</linkeddata>";

$strXML .="</chart>";

 

echo renderChartHTML("../Charts/Gantt.swf", "", $strXML, "myFirst", 600, 300);

?>

</BODY>

</HTML>

 

br,

--jarno

 

 

 

Edited by jarnsura

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