Skip to content

[Epic] Charts: Combo, Multi-Axis, Polish & Theme Surface #13

@MHoroszowski

Description

@MHoroszowski

Problem

Charts in python-pptx assume one plot per chart and one value-axis pair per chart. PowerPoint's most-asked chart capability — combining a bar series with a line series on the same chart, optionally with a secondary axis on the right side — is therefore unreachable through the public API. scanny/python-pptx#141 (multiple axes, 31 comments) and scanny/python-pptx#338 (combo chart, 29 comments) are both top-five-by-engagement on the upstream tracker. Underlying this, chart polish is thin: data-label borders (#716, 17c) cannot be drawn, theme/Accent colors leak (#529, #516), per-point number formatting and per-point invertIfNegative are missing, and there is no Theme object that surfaces the master color/font scheme — meaning charts cannot color-match their host deck programmatically.

Sub-features

  • Combo charts: write multiple <c:plotArea> children (e.g. <c:barChart> + <c:lineChart>) in one chart; expose Chart.plots as a real collection
  • Secondary axis: per-series Series.use_secondary_axis = True plus Chart.secondary_value_axis / Chart.secondary_category_axis
  • Chart.value_axes / category_axes collections (replacing the singular value_axis/category_axis properties)
  • Data-label borders: DataLabel.format.line returning a real LineFormat
  • Per-point DataLabel.number_format, per-point Series.invert_if_negative
  • Chart.update_cached_values() — push current Excel-cached values back to <c:cache> (closes scanny/python-pptx#115)
  • Chart.apply_template() — apply a *.crtx template to an existing chart (closes scanny/python-pptx#243)
  • Theme object surface: Presentation.theme exposing color_scheme (Accent1..6, Background1/2, Text1/2) and font_scheme (Latin major/minor, EastAsian, ComplexScript). Resolves theme-color leaks.
  • Doughnut firstSliceAng and pie color-per-point (scanny/python-pptx#350, #357)

Prior art

Acceptance criteria

  • Combo bar+line chart with secondary axis renders correctly in PowerPoint.
  • Presentation.theme.color_scheme.accent1 returns the <a:srgbClr> value from theme1.xml.
  • Charts authored with theme-color references survive round-trip without losing the reference.
  • Data-label borders are visible after PPT reopen.
  • Existing 50+ chart unit tests continue passing.

Effort: L

Big surface; phase delivery — Phase A combo+secondary axis, Phase B Theme object, Phase C polish (data-label borders, per-point format).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chartsFeature area: chartsepicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P1Important but not urgent

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions