Skip to content

Chart data labels render incorrectly in LibreOffice — need PowerPoint render path #14

@tmustier

Description

@tmustier

Problem

LibreOffice renders chart data labels incorrectly — wrapping them across multiple lines where PowerPoint displays them on one line. For example, a label with Excel number format 0.0"x" renders as:

4.
0x

in LibreOffice, but correctly as 4.0x in PowerPoint. This affects all chart-cell data labels and makes pptx render --engine libreoffice unreliable for verifying chart output.

The root cause is that LibreOffice's chart renderer allocates insufficient horizontal space for data labels, especially when custom number formats include literal suffixes (e.g. "x", "m", "%").

Impact

  • pptx render is our only automated way to visually verify output
  • Chart-cell development relies heavily on render → inspect → fix cycles
  • LibreOffice wrapping makes it impossible to tell if labels are correct without opening in PowerPoint manually

Options

Option A: Fix LibreOffice rendering

Investigate whether LibreOffice chart label rendering can be improved via:

  • Explicit label text box sizing in the chart XML (c:spPr with explicit a:ext)
  • a:bodyPr wrap="none" on label text properties (already partially set)
  • Pre-rendering labels as text overlays instead of native chart data labels
  • LibreOffice-specific CLI flags or configuration

Option B: PowerPoint-native screenshot capture (macOS)

Use AppleScript / osascript to automate PowerPoint for Mac:

  1. Open the PPTX in PowerPoint
  2. Navigate to the target slide
  3. Take a screenshot of the slide area (via screencapture or PowerPoint's export-as-image)
  4. Close or leave open

This would give pixel-perfect renders matching what the user sees. Requires PowerPoint for Mac to be installed.

Option C: Hybrid approach

  • Use LibreOffice for non-chart slides (fast, reliable for text/tables)
  • Fall back to PowerPoint screenshot for slides containing chart shapes
  • Detect chart shapes automatically via the PPTX structure

Acceptance criteria

  • pptx render produces correct single-line data labels like 4.0x, €330m
  • Works in the automated dev loop without manual intervention
  • Ideally supports both --engine libreoffice and --engine powerpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions