Chart2 Direct Wall/Floor Borders (Static)
Overview
The ooodev.format.chart2.direct.wall.borders.LineProperties
class gives the same options as the Chart Wall Borders dialog
as seen in Fig. 720.
See also
Setup
import uno
from ooodev.format.chart2.direct.wall.borders import LineProperties as WallLineProperties
from ooodev.format.chart2.direct.general.borders import LineProperties as ChartLineProperties
from ooodev.office.calc import Calc
from ooodev.office.chart2 import Chart2
from ooodev.utils.color import StandardColor
from ooodev.gui import GUI
from ooodev.loader.lo import Lo
def main() -> int:
with Lo.Loader(connector=Lo.ConnectPipe()):
doc = Calc.open_doc("col_chart3d.ods")
GUI.set_visible(True, doc)
Lo.delay(500)
Calc.zoom(doc, GUI.ZoomEnum.ZOOM_100_PERCENT)
sheet = Calc.get_active_sheet()
Calc.goto_cell(cell_name="A1", doc=doc)
chart_doc = Chart2.get_chart_doc(sheet=sheet, chart_name="col_chart")
chart_bdr_line = ChartLineProperties(color=StandardColor.BLUE_DARK1, width=1.0)
Chart2.style_background(chart_doc=chart_doc, styles=[chart_bdr_line])
wall_bdr_line = WallLineProperties(
color=StandardColor.PURPLE_DARK2, width=1.2, transparency=30
)
Chart2.style_wall(chart_doc=chart_doc, styles=[wall_bdr_line])
floor_bdr_line = WallLineProperties(
color=StandardColor.PURPLE_DARK1, width=0.8, transparency=20
)
Chart2.style_floor(chart_doc=chart_doc, styles=[floor_bdr_line])
Lo.delay(1_000)
Lo.close_doc(doc)
return 0
if __name__ == "__main__":
SystemExit(main())
Setting Line Properties
The LineProperties
class is used to set the border line properties.
Before applying formatting is seen in Fig. 830.
Apply to wall.
from ooodev.format.chart2.direct.wall.borders import LineProperties as WallLineProperties
# ... other code
wall_bdr_line = WallLineProperties(color=StandardColor.PURPLE_DARK2, width=1.2, transparency=30)
Chart2.style_wall(chart_doc=chart_doc, styles=[wall_bdr_line])
Apply to floor.
floor_bdr_line = WallLineProperties(color=StandardColor.PURPLE_DARK1, width=0.8, transparency=20)
Chart2.style_floor(chart_doc=chart_doc, styles=[floor_bdr_line])