Turn off gridlines in bar chart

210 views
Skip to first unread message

Kristóf Kereszturi

unread,
Sep 12, 2022, 8:10:18 AM9/12/22
to openpyx...@googlegroups.com
Is there any way to turn off the gridlines in a chart?
My code  looks like this:

from openpyxl.chart import BarChart, Reference

values = Reference(wq,
                   min_col=6,
                   max_col=6,
                   min_row=18,
                   max_row=21)


chart = BarChart()
chart.type = 'bar'
chart.add_data(values)
chart.legend = None
chart.x_axis.delete = True
chart.y_axis.delete = True

wq.add_chart(chart,"M17")

And this is the output:
kép.png

I want to remove those lines.
Thank you in advance!!!


Christian Harries

unread,
Sep 16, 2024, 10:58:53 AM9/16/24
to openpyxl-users
Hey,

I worked on something similar. Try adding this:

chart.y_axis.majorGridlines = None

Reply all
Reply to author
Forward
0 new messages