google / google-visualization-issues

288 stars 35 forks source link

Gantt Chart sorting #2122

Closed binggao closed 3 years ago

binggao commented 8 years ago

Currently no matter what order you put tasks in the data table, the Gantt Chart reorders them by start date. This is a problem when you want to control the order in your own way. Thanks.

cruwyser commented 8 years ago

We have the same problem when running the code below as the tasks gets jumbled up depending on their start date [ '294', 'Task 1', new Date(2016, 1, 9), new Date(2016, 1, 10), null, 100, null], [ '295', 'Task 2', new Date(2016, 1, 9), new Date(2016, 1, 10), null, 40, null], [ '296', 'Task 3', new Date(2016, 0, 13), new Date(2016, 0, 14), null, 100, null], [ '302', 'Task 4', new Date(2016, 0, 18), new Date(2016, 0, 19), null, 100, null], [ '303', 'Task 5', new Date(2016, 0, 18), new Date(2016, 0, 19), null, 50, null],

+1 for a fix please!

SainathBommisetty commented 8 years ago

Facing the same problem, do we have any solution for this?

jcaughie commented 8 years ago

Me too!

nbering commented 8 years ago

@binggao @cruwyser @SainathBommisetty @jcaughie Sounds like what you are all asking for is a new feature. The Gantt chart was probably explicitly designed to sort by start date. Perhaps it would help the team understand your feature request if you gave an example of how you are using it? I mean, Gantt charts are typically used to visualize the relationships between tasks by time and dependency. What is it about your tasks that makes you want to sort them by anything other than start date? Perhaps some sort of priority or grouping field is desirable?

jcaughie commented 8 years ago

For our use we were using the Gantt chart to report on items that were grandchildren of the original task, for example:

  1. Stage 1 item A item B
  2. Stage 2 item C item D
  3. Stage 3 item E item F

There are some dependencies between items within and across stages however it is not strict, therefore item C above could be completed before item B. We did use the Resource feature to colour code the various Stages but as mentioned the charter itself still sorts by date. A grouping field would be a great addition from my perspective.

neaxi commented 7 years ago

Same feature request here. I would like my data to be sorted by resource first, then by start date. Sorting priority would definitely help.

littlecapa commented 7 years ago

I had the same problem. Then I saw, that google has provided a sample on https://developers.google.com/chart/interactive/docs/gallery/ganttchart (see the simple example), which shows how to do it. Just use dependencies between the activities and gantt chart stops sorting the activities.

sotomo commented 6 years ago

Sorting seems like an extremely basic feature. Makes me think there are business politics behind the decision not to include it.

m-mutti commented 3 years ago

Issue is now solved. Just do sortTasks:false in gantt options. Refer to the url: Configuration Options-Gantt Charts