Hi,
I’m using an AngularJS directive to display the gantt chart
<div schedule-gantt data="tasks" style='width:100%; height:200px;'></div>
Here is the directive code.
var scheduleGanttInstance = Gantt.getGanttInstance();
scheduleGanttInstance.config.scale_unit = "week";
scheduleGanttInstance.config.step = 1;
scheduleGanttInstance.config.date_scale = "%F %Y";
scheduleGanttInstance.config.scale_height = 50;
$scope.$watch($attrs.data, function(collection) {
scheduleGanttInstance.clearAll();
scheduleGanttInstance.parse(collection, "json");
}, true);
$scope.$watch(function() {
return $element[0].offsetWidth + "." + $element[0].offsetHeight;
}, function() {
scheduleGanttInstance.setSizes();
});
scheduleGanttInstance.init($element[0]);
The ‘tasks’ scope variable is filled with data in the controller. However, on load this is displayed and the data area is not stretched out completely. What can be the issue?