Skip to main content
DrawingML objects provide access to formatting properties for shapes, charts, and other visual elements in PowerPoint presentations. These objects handle fill colors, line styles, and other visual attributes.

Overview

The DrawingML API includes several core formatting classes:
  • ColorFormat - Access to color settings including RGB and theme colors
  • FillFormat - Fill properties for shapes (solid, gradient, pattern, etc.)
  • LineFormat - Line and border formatting properties
  • ChartFormat - Visual properties for chart elements

ChartFormat

The ChartFormat object provides access to visual shape properties for chart elements like axes, series, and gridlines.
from pptx import Presentation

prs = Presentation()
chart = prs.slides[0].shapes[0].chart

# Access chart element formatting
axis_format = chart.value_axis.format
axis_format.line.color.rgb = RGBColor(255, 0, 0)
axis_format.fill.solid()

Properties

fill
FillFormat
FillFormat instance for this object, providing access to fill properties such as fill color.
line
LineFormat
LineFormat object providing access to visual properties such as line color and line style.
For detailed information about specific formatting objects, see:

Build docs developers (and LLMs) love