Gantt grafic on python with excel data

Hi guys,
I need to create this on python

I have an excel with the data, the problem is that i have machine 1 with 3 task, then machine 2 with 1 task, machine 3 with 2 task…

Can you guys help me coding this on python?

Can you elaborate some more? It isn’t clear what you need to do.

  • Cameron Simpson

Hi Cameron,

I need to create a gantt grafic. And i have my data on excel. I use this code here:

import plotly.figure_factory as ff
import openpyxl

Open excel file

wb = openpyxl.load_workbook(‘graf.xlsx’)

Select the first worksheet in the file

ws = wb[‘Folha1’]

Creates an empty list to store chart data

dados =

Scroll through the rows in the worksheet

for linha in ws.iter_rows(min_row=2):
# Add row data to list
‘Task’: linha[0].value,
‘Start’: linha[1].value,
‘Finish’: linha[2].value

Create the Gantt chart

fig = ff.create_gantt(dados)

show the graffic


This is my data on excel
As you can see i have different Parts(tasks) for the same machine. In my code the tasks (part) appear on different lines. I need the part 1 and 2 to appear on machine 1. These parts must be on the same line of the graph and they are appearing on different lines.