-1
would like to be able to delete the chart caption generated in excel by the Pyhton program using the openpyxl module below:
from openpyxl import workbook
from openpyxl import load_workbook
from openpyxl import worksheet
from openpyxl.chart import RadarChart, Reference
wb = load_workbook(filename = 'grafico.xlsx')
ws = wb.create_sheet('Grafico')
rows = [
['Equipe', "Grau de Maturidade"],
['Equipe 1', 2.3,],
['Equipe 2', 3.4],
['Equipe 3', 4.2],
['Equipe 4', 2.1],
['Equipe 5', 3.8],
['Equipe 6', 2.8],
]
for row in rows:
ws.append(row)
chart = RadarChart()
chart.type = "marker"
labels = Reference(ws, min_col=1, min_row=1, max_row=7)
data = Reference(ws, min_col=2, max_col=7, min_row=1, max_row=7)
chart.add_data(data, titles_from_data=True)
chart.set_categories(labels)
chart.style = 26
chart.title = "Grau de Maturidade"
chart.y_axis.delete = False
chart.y_axis.scaling.min = 0
chart.y_axis.scaling.max = 5
ws.add_chart(chart, "A17")
wb.save(filename = 'grafico.xlsx')
I was able to find the parameters to define the position of the caption, but I could not delete the caption. For this my chart, it is unnecessary.
Another issue is also when I enlarge the chart size in excel, excel automatically adjusts the range of the y-axis guidelines and starts showing from 0.5 to 0.5, when I would like to keep from 1 point to 1 point.
As I am new here, I would like to understand why my question was classified as without research effort or unclear...
– Marcelo Luís