gantt
gantt copied to clipboard
Scaling horizontally
I am trying to get the gantt chart to take up the full horizontal space, but changing the column_width/steps doesn't seem to be doing anything. Here are my current configurations:
const gantt = new Gantt(ganttRef.current, ganttData, {
on_click: (task) => {},
on_date_change: (task, start, end) => {},
on_progress_change: (task, progress) => {},
on_view_change: (mode) => {},
view_mode: viewMode,
today_button: false,
readonly: true,
});
I attempted altering the column_width from the view scale directly but that didn't seem to do anything:
update_view_scale(view_mode) {
this.options.view_mode = view_mode;
if (view_mode === VIEW_MODE.HOUR) {
this.options.step = 24 / 24;
this.options.column_width = 38;
} else if (view_mode === VIEW_MODE.DAY) {
this.options.step = 24;
this.options.column_width = 38;
} else if (view_mode === VIEW_MODE.HALF_DAY) {
this.options.step = 24 / 2;
this.options.column_width = 38;
} else if (view_mode === VIEW_MODE.QUARTER_DAY) {
this.options.step = 24 / 4;
this.options.column_width = 38;
} else if (view_mode === VIEW_MODE.WEEK) {
this.options.step = 24 * 7;
this.options.column_width = 140;
} else if (view_mode === VIEW_MODE.MONTH) {
this.options.step = 24 * 30;
this.options.column_width = 120;
} else if (view_mode === VIEW_MODE.YEAR) {
this.options.step = 24 * 365;
this.options.column_width = 120;
}
}