From 88661d0a835398bc42bdfbf646f8dcfc26316f23 Mon Sep 17 00:00:00 2001 From: Omri Danan Date: Wed, 15 Aug 2018 15:55:28 +0300 Subject: [PATCH] Show colors at the top of the colorbar when creating a gantt with custom colors --- plotly/figure_factory/_gantt.py | 1 + plotly/tests/test_optional/test_tools/test_figure_factory.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/plotly/figure_factory/_gantt.py b/plotly/figure_factory/_gantt.py index e8c8a90e40f..36024e6c1b5 100644 --- a/plotly/figure_factory/_gantt.py +++ b/plotly/figure_factory/_gantt.py @@ -502,6 +502,7 @@ def gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width, entry = dict( x=[tasks[index]['x0'], tasks[index]['x1']], y=[groupID, groupID], + showlegend=False, name='', marker={'color': 'white'} ) diff --git a/plotly/tests/test_optional/test_tools/test_figure_factory.py b/plotly/tests/test_optional/test_tools/test_figure_factory.py index 0ad6ffc7fca..2a3d227cfa9 100644 --- a/plotly/tests/test_optional/test_tools/test_figure_factory.py +++ b/plotly/tests/test_optional/test_tools/test_figure_factory.py @@ -1351,26 +1351,31 @@ def test_gannt_groups_and_descriptions(self): exp_gantt_chart = { 'data': [{'marker': {'color': 'white'}, 'name': '', + 'showlegend': False, 'text': 'Task A - 1', 'x': ['2008-10-05', '2009-04-15'], 'y': [2, 2]}, {'marker': {'color': 'white'}, 'name': '', + 'showlegend': False, 'text': 'Task B - 1', 'x': ['2008-12-06', '2009-03-15'], 'y': [1, 1]}, {'marker': {'color': 'white'}, 'name': '', + 'showlegend': False, 'text': 'Task C - 1', 'x': ['2008-09-07', '2009-03-15'], 'y': [0, 0]}, {'marker': {'color': 'white'}, 'name': '', + 'showlegend': False, 'text': 'Task C - 2', 'x': ['2009-05-08', '2009-04-15'], 'y': [0, 0]}, {'marker': {'color': 'white'}, 'name': '', + 'showlegend': False, 'text': 'Task A - 2', 'x': ['2009-04-20', '2009-05-30'], 'y': [2, 2]},