Charts API

pyopenxlsx supports common Excel chart types via the worksheet façade. Prefer string chart types and the fluent Chart wrapper; set wrap=False when you need the raw native object.

Chart types

Friendly names resolve case-insensitively to XLChartType, including:

  • Bar / Column family (stacked, percent, 3D)

  • Line, Pie, Doughnut, Scatter variants

  • Area, Radar, Bubble, Stock, Surface

from pyopenxlsx import chart_type
from pyopenxlsx._openxlsx import XLChartType

assert chart_type("column") == XLChartType.Column

Native path

from pyopenxlsx._openxlsx import XLChartType

native = ws.add_chart(XLChartType.Bar, "C1", 5, 5, 400, 300, wrap=False)
native.set_title("Native")
native.add_series_ref("Sheet1!$B$2:$B$4", "S1", "Sheet1!$A$2:$A$4")