MaTeMaTuK / gantt-task-react

Gantt chart for React with Typescript
MIT License
847 stars 471 forks source link

Usage questions #133

Open ccamacho opened 1 year ago

ccamacho commented 1 year ago

This is a great Gantt chart! Thanks for the hard work, but I have some usage questions.

Is it possible to resize the Gantt chart to an specific width? Is it possible to remove the From and To columns? Im using the 0.3.8 version

Thanks!

MatthewHazeTrinh commented 1 year ago

If you want to remove the From and To columns, you can do the following:

You can copy paste this component: https://github.com/MaTeMaTuK/gantt-task-react/blob/main/src/components/task-list/task-list-header.tsx

And this: https://github.com/MaTeMaTuK/gantt-task-react/blob/main/src/components/task-list/task-list-table.tsx

Comment out or remove the divs as shown below: image image

And then add them to the Gantt component after importing them: image

This will overwrite the tasklistheader and tasklisttable with your own components and remove the 'from' and to' columns from the table. I know my screenshot below doesn't show it, but it works. This way, you can also add your own columns, which I did with a "Phase" column: image

Regarding custom width, I don't know if it will solve your use-case, but I wrapped the Gantt task react component around a div, and specified a width, which looks like this: image image

thegliche commented 1 year ago

Hello Can one have multiple tasks on one row?

elietech commented 1 year ago

Yes, this would be most helpfull...multiple tasks on the same row...can we do this?