Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working on gantt chart

Status
Not open for further replies.

misslois74

Programmer
Sep 27, 2008
63
0
0
PH
im working on a system right now in which i would be needing a gantt chart to display the progress of a particular task in which i have the date together with the task and it should somehow highlight the scheduled dates for a particular task need to get ideas on how can i work on these.
hope anybody could enlighten me on these or share who have done a similar thing
thanks in advance....
 
what are you asking for?

* a recommendation for an existing product? (MS Project)
someone to code it for you? (see rentacoder.com)
* help with fixing a solution you have coded? (please explain where you are stuck)
* references to opensource class libraries that might be able to help you? (jpgraph, hotscripts, phpclasses.org, flashgantt etc etc).
 
hi jpadie,
what im asking for is to a sample application that makes use of a gantt chart (if there is!) since i would need to incorporate one on the project im doing by the way what im developing is similar to what MS Project does.
 
Presume you want this app to be web based ?
I think MS project comes in a server version which might well have an API, or you could use the standard Ms Project which has COM interface you could script.
 
im already working on customizing a project management system and have done quite a lot what im focusing now is integrating a gantt chart to display the timetable of certain tasks and milestones and im using JPGraph but im encountering error which says "the image cannot be displayed because it contain errors" when i try running it as a standalone script its working but when i integrate the script in the MVC framework im using it started getting these error....
anybody has an idea how to solve this error or encounter the same and was able to work on these...
 
ok, just for clairity.
Your issue is the display of an image you have created dynamically using JPGraph. Is this an actual .JPG or is it being created on the fly by code e.g. <img src=module.php>
The project managment but is a red herring ?
When you say free standing it's ok, what do you mean by this?, you run a .php page outside of your MVC framework but when you call it via the MVC you get the error ?.
I've seen the an error message before about containing errors on some php based picture sharing web sites. The image was ok but was taking an age to process dynamically.
 
i was checking out the codes actually when i comment the $graph->Stroke() im no longer getting the error i guess it has something to do with these... my issue is displaying the image, when i say stand alone i mean is i copied and pasted the sample codes from the tutorial to a php script and tried run the script locally the chart is displaying successfully and when i tried putting the codes to the controller and to the view which is the actual framework im using its displaying that error
 
this is fumbling in the dark. be specific.

* what is the code that you are trying? please provide.
* what is the MVC framework that you are using?
 
- for the MVC framework im customizing with that of Project Pier
- here is the sample code im using for the Report Controller:

Code:
<?php

  /**
  * Report controller
  *
  * @version 1.0
  *
  */
  class ReportController extends ApplicationController {
    
    /**
    * Prepare this controller
    *
    * @param void
    * @return ProjectController
    */
    function __construct() {
      parent::__construct();
      prepare_company_website_controller($this, 'project_website');
    } // __construct
    
    /**
    * Call overview action
    *
    * @param void
    * @return null
    */
    function index() {
	    $this->addHelper('progress_bar');
    	$project = active_project();
		tpl_assign('proj_reports', $project->getTasks());
		tpl_assign('active_projects', logged_user()->getActiveProjects());
		
		//$this->forward('overview');
    } // index
	
	function gantt_task()
	{
		//$this->addHelper('jpgraph');
		//$this->addHelper('jpgraph_gantt');
		include_once 'helpers/jpgraph.php';
		include_once 'helpers/jpgraph_gantt.php';
		
		$graph = new GanttGraph();
		tpl_assign('graph', $graph);
		
		$activity = new GanttBar(0,"Project","2001-12-20","2002-02-20");
		tpl_assign('activity', $activity);
		
		$project = active_project();
		tpl_assign('proj_reports', $project->getTasks());
		tpl_assign('active_projects', logged_user()->getActiveProjects());
		
	}	
	
}
    
?>




and here is for the view:

Code:
<?php

  set_page_title(lang('report'));
  project_tabbed_navigation(PROJECT_TAB_REPORTS);
  project_crumbs(lang('task_graph_view'));  
  
  add_page_action(lang('task_list_view'), get_url('report', 'index'));
  add_page_action(lang('task_graph_view'), get_url('report', 'gantt_task')); 
  add_page_action(lang('milestone_report'), get_url('report', 'gantt_milestone')); 


// A new graph with automatic size
$graph = new GanttGraph(0,0, "auto");

$graph->SetShadow();

// Add title and subtitle
$graph->title->Set("Example of a Gantt Chart");
$graph->title-> SetFont(FF_ARIAL,FS_BOLD,12);
$graph->subtitle->Set("(Draft version)");

// Show day, week and month scale
$graph->ShowHeaders( GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);

// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale-> week->SetStyle(WEEKSTYLE_FIRSTDAY);

// Make the week scale font smaller than the default
$graph->scale-> week->SetFont(FF_FONT0);

// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale-> month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);

// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0,"Project", "2001-12-20", "2002-02-20");

// Yellow diagonal line pattern on a red background

$activity->SetPattern(BAND_RDIAG,"yellow");
$activity->SetFillColor("red");

//  A new activity on row '0'
$graph->Add($activity);

// Display the Gantt chart  */

$graph->Add($activity);

// Display the Gantt chart
$graph->Stroke(); 

//$graph->Stroke(); 

?>
 
So,
the sample code works ok, but the code you've written doesn't work - so it's an issue with the way you've done your code - yes ??
 
now, im having these error:

JpGraph Error: HTTP headers have already been sent.
 
you are outputting some data before you output the image headers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top