FJSJ
FJSJ

Reputation: 229

OpenPyXL - How to set GraphicalProperties to chart's border

I would like to know whether or not there is any way of setting graphical properties to chart's borders.

I have been looking similar threads and I found out the next one:

openpyxl - Ability to remove border from charts?

I have tried the first answer but It did not work. So, I decided to follow @Charlie recommendation to find the variables that need to be setting or changing. After doing it, I got next:

https://www.dropbox.com/s/jogykal32mmj1rr/Chart_1.PNG?dl=0 https://www.dropbox.com/s/e2fpqh4m3t1opjf/XML_Chart_1.PNG?dl=0

https://www.dropbox.com/s/loiu6ppypjdblc0/Chart_2.PNG?dl=0 https://www.dropbox.com/s/raj3hggrbjlw8x5/XML_Chart_2.PNG?dl=0

So, I need to give GraphicalProperties to chartSpce. Looking over the documentation I find next class:

class openpyxl.chart.chartspace.ChartSpace

which contains spPr attribute. However, I cannot give the graphical properties to the chart. I am using a sentence like:

ext_frame = LineProperties(prstDash = "solid", solidFill = "FF0000")
chart.graphical_properties = GraphicalProperties(ln = ext_frame)

Is there any other way of setting graphical properties to chartSpace? What would it be the right way of doing it?

Upvotes: 0

Views: 1334

Answers (1)

Charlie Clark
Charlie Clark

Reputation: 19507

It's worth noting that some stuff just isn't supported (yet). openpyxl tries to reduce the number of layers – chart, chartspace, plotarea, chart, … – so that you only need to work with the chart. Support could be added relatively easily making sure that relevant attributes are copied to the relevant objects when charts are written or read.

Upvotes: 1

Related Questions