@@ -1761,7 +1761,10 @@ def _gantt(chart, colors, title, bar_width, showgrid_x, showgrid_y,
1761
1761
# name is not already in the list
1762
1762
if not group_tasks or tn not in task_names :
1763
1763
task_names .append (tn )
1764
- task_names .reverse ()
1764
+ # Gurantees that for grouped tasks the tasks that are inserted first
1765
+ # are shown at the top
1766
+ if group_tasks :
1767
+ task_names .reverse ()
1765
1768
1766
1769
1767
1770
color_index = 0
@@ -1900,7 +1903,10 @@ def _gantt_colorscale(chart, colors, title, index_col, show_colorbar,
1900
1903
# name is not already in the list
1901
1904
if not group_tasks or tn not in task_names :
1902
1905
task_names .append (tn )
1903
- task_names .reverse ()
1906
+ # Gurantees that for grouped tasks the tasks that are inserted first
1907
+ # are shown at the top
1908
+ if group_tasks :
1909
+ task_names .reverse ()
1904
1910
1905
1911
for index in range (len (tasks )):
1906
1912
tn = tasks [index ]['name' ]
@@ -1996,7 +2002,10 @@ def _gantt_colorscale(chart, colors, title, index_col, show_colorbar,
1996
2002
# name is not already in the list
1997
2003
if not group_tasks or tn not in task_names :
1998
2004
task_names .append (tn )
1999
- task_names .reverse ()
2005
+ # Gurantees that for grouped tasks the tasks that are inserted first
2006
+ # are shown at the top
2007
+ if group_tasks :
2008
+ task_names .reverse ()
2000
2009
2001
2010
for index in range (len (tasks )):
2002
2011
tn = tasks [index ]['name' ]
@@ -2152,7 +2161,10 @@ def _gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width,
2152
2161
# name is not already in the list
2153
2162
if not group_tasks or tn not in task_names :
2154
2163
task_names .append (tn )
2155
- task_names .reverse ()
2164
+ # Gurantees that for grouped tasks the tasks that are inserted first
2165
+ # are shown at the top
2166
+ if group_tasks :
2167
+ task_names .reverse ()
2156
2168
2157
2169
for index in range (len (tasks )):
2158
2170
tn = tasks [index ]['name' ]
0 commit comments