title: How to specify additional colors in Plotly Gantt-chart?
body: <p>I am using to Plotly to plot a Gantt chart:</p>
  
  <pre class="lang-py prettyprint-override"><code>fig = ff.create_gantt(df, index_col='Resource', show_colorbar=True, group_tasks=True)
  </code></pre>
  
  <p>When the index in</p>
  
  <pre class="lang-py prettyprint-override"><code>index_col='Resource'
  </code></pre>
  
  <p>exceeds <strong>10</strong> a error comes up:</p>
  
  <blockquote>
    <p>plotly.exceptions.PlotlyError: Error. The number of colors in 'colors' must be no less than the number of unique index values in your group column.</p>
  </blockquote>
  
  <p>Which I think is due to the fact that the default colors of Plotly are limited to ten different colors (e. g. <a href="https://community.plot.ly/t/plotly-colours-list/11730" rel="nofollow noreferrer">Plotly colours list</a>)</p>
  
  <p>I want to have more colors (<code>&gt;= index of 'Resource'</code>). How can I add and define them?</p>
  
  <p><strong>Edit:</strong>
  Here is an example which can be used for testing</p>
  
  <pre class="lang-py prettyprint-override"><code>from __future__ import print_function
  
  from collections import defaultdict
  
  from plotly.offline import plot
  import plotly.figure_factory as ff
  import pandas as pd
  from pandas import ExcelWriter
  from pandas import ExcelFile
  
  import datetime
  
  
  
  def gantt_test():
      """Solve a small flexible jobshop problem."""
  
      # convert to date
      serial = 43466.0 # 01.01.2019 Excel
      seconds = (serial - 25569) * 86400.0 # convert to seconds
      date_date = datetime.datetime.utcfromtimestamp(seconds)
      date_string = date_date.strftime("%Y-%m-%d %H:%M:%S")
  
      df = [dict(Task="machine_99", Start=0, Finish=1, Resource="job_99")]
      df.clear()
  
      start_value = 0 # in min
      duration = 120  # in min
  
      for i in range(1, 12):              
          b_dict = dict(Task="M " + str(i), Start=datetime.datetime.utcfromtimestamp((serial - 25569 + (start_value/(60*24.0))) * 86400.0).strftime("%Y-%m-%d %H:%M:%S"), Finish=datetime.datetime.utcfromtimestamp((serial - 25569 + (start_value +duration)/(60*24.0)) * 86400.0).strftime("%Y-%m-%d %H:%M:%S"), Resource="job " + str(i))            
          df.append(b_dict)
          start_value = 10*i
  
  
  
  
  
      fig = ff.create_gantt(df, index_col='Resource', show_colorbar=True, group_tasks=True)
  
      plot(fig, filename='gantt-group-tasks-together.html')
  
  
  gantt_test()
  
  
  </code></pre>
  
  <p>If you change</p>
  
  <pre class="lang-py prettyprint-override"><code>    for i in range(1, 12):   
  </code></pre>
  
  <p>to less than </p>
  
  <blockquote>
    <p>12</p>
  </blockquote>
  
  <p>it works: 
  <a href="https://i.stack.imgur.com/tRr5W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tRr5W.png" alt="enter image description here"></a></p>