Skip to content

Commit 88661d0

Browse files
committed
Show colors at the top of the colorbar when creating a gantt with custom colors
1 parent 79b7a83 commit 88661d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: plotly/figure_factory/_gantt.py

+1
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ def gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width,
502502
entry = dict(
503503
x=[tasks[index]['x0'], tasks[index]['x1']],
504504
y=[groupID, groupID],
505+
showlegend=False,
505506
name='',
506507
marker={'color': 'white'}
507508
)

Diff for: plotly/tests/test_optional/test_tools/test_figure_factory.py

+5
Original file line numberDiff line numberDiff line change
@@ -1351,26 +1351,31 @@ def test_gannt_groups_and_descriptions(self):
13511351
exp_gantt_chart = {
13521352
'data': [{'marker': {'color': 'white'},
13531353
'name': '',
1354+
'showlegend': False,
13541355
'text': 'Task A - 1',
13551356
'x': ['2008-10-05', '2009-04-15'],
13561357
'y': [2, 2]},
13571358
{'marker': {'color': 'white'},
13581359
'name': '',
1360+
'showlegend': False,
13591361
'text': 'Task B - 1',
13601362
'x': ['2008-12-06', '2009-03-15'],
13611363
'y': [1, 1]},
13621364
{'marker': {'color': 'white'},
13631365
'name': '',
1366+
'showlegend': False,
13641367
'text': 'Task C - 1',
13651368
'x': ['2008-09-07', '2009-03-15'],
13661369
'y': [0, 0]},
13671370
{'marker': {'color': 'white'},
13681371
'name': '',
1372+
'showlegend': False,
13691373
'text': 'Task C - 2',
13701374
'x': ['2009-05-08', '2009-04-15'],
13711375
'y': [0, 0]},
13721376
{'marker': {'color': 'white'},
13731377
'name': '',
1378+
'showlegend': False,
13741379
'text': 'Task A - 2',
13751380
'x': ['2009-04-20', '2009-05-30'],
13761381
'y': [2, 2]},

0 commit comments

Comments
 (0)