@@ -1739,6 +1739,8 @@ def _gantt(chart, colors, title, bar_width, showgrid_x, showgrid_y,
1739
1739
task = dict (x0 = chart [index ]['Start' ],
1740
1740
x1 = chart [index ]['Finish' ],
1741
1741
name = chart [index ]['Task' ])
1742
+ if 'Description' in chart [index ]:
1743
+ task ['description' ] = chart [index ]['Description' ]
1742
1744
tasks .append (task )
1743
1745
1744
1746
shape_template = {
@@ -1781,14 +1783,16 @@ def _gantt(chart, colors, title, bar_width, showgrid_x, showgrid_y,
1781
1783
color_index = 0
1782
1784
tasks [index ]['fillcolor' ] = colors [color_index ]
1783
1785
# Add a line for hover text and autorange
1784
- data .append (
1785
- dict (
1786
+ entry = dict (
1786
1787
x = [tasks [index ]['x0' ], tasks [index ]['x1' ]],
1787
1788
y = [groupID , groupID ],
1788
1789
name = '' ,
1789
1790
marker = {'color' : 'white' }
1790
1791
)
1791
- )
1792
+ if "description" in tasks [index ]:
1793
+ entry ['text' ] = tasks [index ]['description' ]
1794
+ del tasks [index ]['description' ]
1795
+ data .append (entry )
1792
1796
color_index += 1
1793
1797
1794
1798
layout = dict (
@@ -1862,6 +1866,8 @@ def _gantt_colorscale(chart, colors, title, index_col, show_colorbar,
1862
1866
task = dict (x0 = chart [index ]['Start' ],
1863
1867
x1 = chart [index ]['Finish' ],
1864
1868
name = chart [index ]['Task' ])
1869
+ if 'Description' in chart [index ]:
1870
+ task ['description' ] = chart [index ]['Description' ]
1865
1871
tasks .append (task )
1866
1872
1867
1873
shape_template = {
@@ -1930,14 +1936,17 @@ def _gantt_colorscale(chart, colors, title, index_col, show_colorbar,
1930
1936
)
1931
1937
1932
1938
# add a line for hover text and autorange
1933
- data .append (
1934
- dict (
1939
+ entry = dict (
1935
1940
x = [tasks [index ]['x0' ], tasks [index ]['x1' ]],
1936
1941
y = [groupID , groupID ],
1937
1942
name = '' ,
1938
1943
marker = {'color' : 'white' }
1939
1944
)
1940
- )
1945
+ if "description" in tasks [index ]:
1946
+ entry ['text' ] = tasks [index ]['description' ]
1947
+ del tasks [index ]['description' ]
1948
+ data .append (entry )
1949
+
1941
1950
1942
1951
if show_colorbar is True :
1943
1952
# generate dummy data for colorscale visibility
@@ -2006,14 +2015,16 @@ def _gantt_colorscale(chart, colors, title, index_col, show_colorbar,
2006
2015
]
2007
2016
2008
2017
# add a line for hover text and autorange
2009
- data .append (
2010
- dict (
2018
+ entry = dict (
2011
2019
x = [tasks [index ]['x0' ], tasks [index ]['x1' ]],
2012
2020
y = [groupID , groupID ],
2013
2021
name = '' ,
2014
2022
marker = {'color' : 'white' }
2015
2023
)
2016
- )
2024
+ if "description" in tasks [index ]:
2025
+ entry ['text' ] = tasks [index ]['description' ]
2026
+ del tasks [index ]['description' ]
2027
+ data .append (entry )
2017
2028
2018
2029
if show_colorbar is True :
2019
2030
# generate dummy data to generate legend
@@ -2103,6 +2114,8 @@ def _gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width,
2103
2114
task = dict (x0 = chart [index ]['Start' ],
2104
2115
x1 = chart [index ]['Finish' ],
2105
2116
name = chart [index ]['Task' ])
2117
+ if 'Description' in chart [index ]:
2118
+ task ['description' ] = chart [index ]['Description' ]
2106
2119
tasks .append (task )
2107
2120
2108
2121
shape_template = {
@@ -2157,14 +2170,16 @@ def _gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width,
2157
2170
tasks [index ]['fillcolor' ] = colors [chart [index ][index_col ]]
2158
2171
2159
2172
# add a line for hover text and autorange
2160
- data .append (
2161
- dict (
2173
+ entry = dict (
2162
2174
x = [tasks [index ]['x0' ], tasks [index ]['x1' ]],
2163
2175
y = [groupID , groupID ],
2164
2176
name = '' ,
2165
2177
marker = {'color' : 'white' }
2166
2178
)
2167
- )
2179
+ if "description" in tasks [index ]:
2180
+ entry ['text' ] = tasks [index ]['description' ]
2181
+ del tasks [index ]['description' ]
2182
+ data .append (entry )
2168
2183
2169
2184
if show_colorbar is True :
2170
2185
# generate dummy data to generate legend
0 commit comments