openpyxl supports creating barlinescatterand pie charts using the data in sheet' cells to make chartyou need to do the following create reference object from rectangular selection of cells create series object by passing in the reference object create chart object append the series object to the chart object add the chart object to the worksheet objectoptionally specifying which cell should be the top-left corner of the chart the reference object requires some explaining you create reference objects by calling the openpyxl chart reference(function and passing three arguments the worksheet object containing your chart data tuple of two integersrepresenting the top-left cell of the rectangular selection of cells containing your chart datathe first integer in the tuple is the rowand the second is the column note that is the first rownot tuple of two integersrepresenting the bottom-right cell of the rectangular selection of cells containing your chart datathe first integer in the tuple is the rowand the second is the column figure - shows some sample coordinate arguments figure - from left to right( )( )( )( )( )( enter this interactive shell example to create bar chart and add it to the spreadsheetimport openpyxl wb openpyxl workbook(sheet wb active for in range( )create some data in column sheet['astr( ) refobj openpyxl chart reference(sheetmin_col= min_row= max_col= max_row=