Chart2 Direct Wall/Floor Borders
Overview
The style_border_line()
method gives the same options as the Chart Wall Borders dialog
as seen in Fig. 541.
Setup
from __future__ import annotations
from pathlib import Path
import uno
from ooodev.calc import CalcDoc, ZoomKind
from ooodev.loader.lo import Lo
from ooodev.utils.color import StandardColor
def main() -> int:
with Lo.Loader(connector=Lo.ConnectPipe()):
fnm = Path.cwd() / "tmp" / "col_chart3d.ods"
doc = CalcDoc.open_doc(fnm=fnm, visible=True)
Lo.delay(500)
doc.zoom(ZoomKind.ZOOM_100_PERCENT)
sheet = doc.sheets[0]
sheet["A1"].goto()
chart_table = sheet.charts[0]
chart_doc = chart_table.chart_doc
_ = chart_doc.style_border_line(
color=StandardColor.PURPLE_DARK1,
width=0.7,
)
wall = chart_doc.first_diagram.wall
wall.style_border_line(
StandardColor.PURPLE_DARK1, width=0.8, transparency=20
)
Lo.delay(1_000)
doc.close()
return 0
if __name__ == "__main__":
SystemExit(main())
Setting Line Properties
The style_border_line()
method is called to set the border line properties.
Before applying formatting is seen in Fig. 830.
Apply to wall.
from ooodev.utils.color import StandardColor
# ... other code
wall = chart_doc.first_diagram.wall
wall.style_border_line(
StandardColor.PURPLE_DARK1, width=0.8, transparency=20
)
Apply to floor.
from ooodev.utils.color import StandardColor
# ... other code
floor = chart_doc.first_diagram.floor
floor.style_border_line(
StandardColor.PURPLE_DARK1, width=0.8, transparency=20
)