Hei! I want to make a cleaner look on a train analyze project.
I want to show the chart without the -Serie1 text box.
Some of the code in action:
df.to_excel(writer, sheet_name='Year_sheet', startrow=1, header=False, index=False)
workbook = writer.book
workbook = writer.book
worksheet1 = writer.sheets['Year_sheet']
chart_weight = workbook.add_chart({'type': 'line'})
chart_weight.add_series({'values': '=Year_sheet!$B$2:$B$13'})
chart_weight.set_x_axis({'name': 'Months'})
worksheet1.insert_chart('A16', chart_weight)
chart_weight.set_title({'name': 'Gross tonnage'})
writer.save()
There will be severalcharts so it's essential to save horisontal space an get rid the -Serie1 text on all charts. Hope you have some tips on how to solve this issue
CodePudding user response:
According to the docs:
you should be able to remove the legend with this function :
chart.set_legend({'none': True})
or
chart.set_legend({'position': 'none'})