Creating a BarChart in Python 3.9.6

I am learning Python using the video “Python Tutorial for Beginners Full Course” by Mosh.

These codes were created by Mosh

import openpyxl as xl
from openpyxl.chart import BarChart, Reference

wb = xl.load_workbook(“transaction1.xlsx”)
sheet = wb[“Sheet1”]
cell = sheet[“a1”]
cell = sheet.cell(1, 1)

print(cell.value)

print(sheet.max_row)

for row in range(2, sheet.max_row +1):

print(row)

cell = sheet.cell(row, 3)

print(cell.value)

corrected_price = cell.value * 0.9
corrected_price_cell = sheet.cell(row, 4)
corrected_price_cell.value = corrected_price

values = Reference(sheet,
min_row=2,
max_row=sheet.max_row,
min_col=4,
max_col=4)

chart = BarChart
chart.add_data(values)
sheet.add_chart(chart, ‘e2’)

wb.save(“transaction2.xlsx”)

I noticed that it ran successfully on the video but when I run, I get the following error

Traceback (most recent call last):
File “C:\Okosieme\General\Personal\Mexxanda Provisions\Python Training\MyPrograms\package2.py”, line 25, in
chart.add_data(values)
TypeError: add_data() missing 1 required positional argument: ‘data’

Process finished with exit code 1

I have tried my best to debug the code but I keep getting the same error.

Please who can help me resolve this error