Hi all,
I just found this incredible gantt chart and starting playing with it in my javascript class, I tried adding some dummy data and the result was slightly cut off (attached) and the Dates are a month behind? Is January month 0? Everything else went smooth but with the header cut off the scrolling doesn’t work well either. I’m using the chart in an Ext (js framework) Window
Here is my code
var gDom = this.ganttWindow.body.dom;
// Initialize Gantt data structures
var project = new GanttProjectInfo(1, "My Chart", new Date(2011, 3, 1));
var pTask = new GanttTaskInfo(20, "Create Gantt Chart", new Date(2011, 3, 2), 120, 30, "");
pTask.addChildTask(new GanttTaskInfo(21, "Fill with data", new Date(2011, 3, 2), 5, 80, ""));
pTask.addChildTask(new GanttTaskInfo(22, "Implement dependencies", new Date(2011, 3, 3), 24, 10, ""));
project.addTask(pTask);
var pTask2 = new GanttTaskInfo(30, "Web service comm", new Date(2011, 3, 4), 72, 10, "");
pTask2.addChildTask(new GanttTaskInfo(31, "Write web service", new Date(2011, 3, 4), 2, 70, ""));
project.addTask(pTask2);
// Create Gantt control
ganttChartControl = new GanttChart();
ganttChartControl.setImagePath("js/codebase/imgs/");
ganttChartControl.setStylePath("js/codebase/dhtmlxgantt.css");
ganttChartControl.setEditable(false);
ganttChartControl.showTreePanel(true);
ganttChartControl.showContextMenu(false);
ganttChartControl.showDescTask(true,'s-f');
ganttChartControl.showDescProject(true,'d');
// Load data structure
ganttChartControl.addProject(project);
// Build control on the page
ganttChartControl.create(gDom);
For those of you who picked up on my DOM element, I had to change the code to pass the element itself since it’s in a window that isn’t defined in my html…
Thank you for the help! I don’t know what to do…