Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling horizontally #420

Open
Dygitz opened this issue Aug 29, 2024 · 0 comments
Open

Scaling horizontally #420

Dygitz opened this issue Aug 29, 2024 · 0 comments

Comments

@Dygitz
Copy link

Dygitz commented Aug 29, 2024

image

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;
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant