Our state of the art Gantt chart


Post by remyvillulles »

Hi,

Is it possible to ignore hours (use only days) for gantt? My tasks end up having a 1.9 duration but we'd like them to be per day.

Thank you,
Remy


Post by mats »

How do you mean ignore? Render 1.9 as 1, or 2? Something else?


Post by remyvillulles »

Sorry, set the time basis to days instead of hours. When I resize mes tasks, I can resize them per hour, I'd like to resize them per day.


Post by alex.l »

All the best,
Alex


Post by alex.l »

Please read docs here: https://bryntum.com/docs/gantt/#Gantt/view/Gantt#config-viewPreset
If you don't provide a full config of your viewPreset, you need to specify base property in your config, as example:

viewPreset : {
  base           : 'hourAndDay',
  id             : 'myHourAndDayPreset',
  timeResolution : {
      unit      : "day",
      increment : 1
  },
  [...]

All the best,
Alex


Post by remyvillulles »

By doing like this:

viewPreset: new ViewPreset({
    id: "ganttPreset",
    base: "day",
    timeResolution: {
      unit: "day",
      increment: 1,
    },
  }),

I have the following error (which by the way completely crashes the app like a lot of unhandled errors within bryntum, I have to close the tab and reopen it...)

Screenshot 2020-12-01 at 11.51.09.png
Screenshot 2020-12-01 at 11.51.09.png (337.27 KiB) Viewed 1051 times

Post by alex.l »

What version of the Gantt are you currently using? I tested it with our basic example in 4.0.3 using umd build and it works to me with your config.

new Gantt({
    appendTo : 'container',

project,

viewPreset : {
    base    : 'day',
    id      : 'ganttPreset',
    timeResolution : {
        unit      : 'day',
        increment : 1
      }
},

[...]
});

Try to reproduce with our examples, please?
Btw, I see not enough closed braces in the end of your snippet. Cannot be sure, of course.

All best,
Alex

All the best,
Alex


Post by remyvillulles »

The issue seemed to be the new ViewPreset which wasn't working. Using the object directly seems okay. However, if I drag a task and on the overlay, it gets to the next day. If I release the mouse click at this point, it shows me 5.9 days instead of the 6 expected (see screenshots)

Screenshot 2020-12-01 at 12.59.32.png
Screenshot 2020-12-01 at 12.59.32.png (748.48 KiB) Viewed 1046 times

On this screenshot, I'm dragging the task from the 20th to the 21st of september and Bryntum is showing me 21st

Screenshot 2020-12-01 at 12.59.50.png
Screenshot 2020-12-01 at 12.59.50.png (63.98 KiB) Viewed 1046 times

Here I released the mouse button at the same place it is on the first image but the duration is incorrect


Post by pmiklashevich »

Please pay attention to the start date. It's few hours shifted ahead (on both screenshoots). Since the start date in not at the midnight, the duration is less than 6 days.

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply