<jupyter_start><jupyter_text><jupyter_code>from plotly.figure_factory import create_gantt

# Datos
df = [
      dict(Task="Tarea 1", Start='2021-01-01', Finish='2021-02-10', Complete=100),
      dict(Task="Tarea 2", Start='2021-01-01',Finish='2021-02-15', Complete=100),
      dict(Task="Tarea 3", Start='2021-01-01',Finish='2021-02-20', Complete=75),
      dict(Task="Tarea 4", Start='2021-02-01',Finish='2021-12-12', Complete=50)
    ]


# Configuraciones del diagrama
fig = create_gantt(
    df[::-1], 
    #colors='Blues', 
    colors='Viridis', 
    index_col='Complete',
    show_colorbar=True, 
    bar_width=0.2,
    showgrid_x=True, 
    showgrid_y=True,
    title="Cronograma de trabajo"
  )
fig.show()
import plotly.figure_factory as ff

df = [dict(Task="Job-1", Start='2017-01-01', Finish='2017-02-02', Resource='Complete'),
      dict(Task="Job-1", Start='2017-02-15', Finish='2017-03-15', Resource='Incomplete'),
      dict(Task="Job-2", Start='2017-01-17', Finish='2017-02-17', Resource='Not Started'),
      dict(Task="Job-2", Start='2017-01-17', Finish='2017-02-17', Resource='Complete'),
      dict(Task="Job-3", Start='2017-03-10', Finish='2017-03-20', Resource='Not Started'),
      dict(Task="Job-3", Start='2017-04-01', Finish='2017-04-20', Resource='Not Started'),
      dict(Task="Job-3", Start='2017-05-18', Finish='2017-06-18', Resource='Not Started'),
      dict(Task="Job-4", Start='2017-01-14', Finish='2017-03-14', Resource='Complete')]

colors = {'Not Started': 'rgb(220, 0, 0)',
          'Incomplete': (1, 0.9, 0.16),
          'Complete': 'rgb(0, 255, 100)'}

fig = ff.create_gantt(df, colors=colors, index_col='Resource', show_colorbar=True,
                      group_tasks=True)
fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20944792259533296, 'fraction_numerical': 0.13375071143995446, 'mean_word_length': 4.201183431952662, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '579259', 'license': 'MIT', 'n_tokens_mistral': 811, 'n_tokens_neox': 660, 'n_words': 102, 'path': 'Gantt.ipynb', 'repo_name': 'Baxi19/Gantt', 'size': '1757'}