Skip to content

pptx: missing chart data points render as the literal string "None" #2526

Description

what happens

pptx charts render missing data points as the literal string "None" inside the markdown table. a series like (1.0, None, 3.0) produces:

| Q2 | None |

instead of an empty cell, which reads like a value named None in every downstream consumer.

repro

from pptx import Presentation
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
from io import BytesIO
from markitdown import MarkItDown, StreamInfo

prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[5])
cd = CategoryChartData()
cd.categories = ["Q1", "Q2", "Q3"]
cd.add_series("Sales", (1.0, None, 3.0))
slide.shapes.add_chart(XL_CHART_TYPE.COLUMN_CLUSTERED, 0, 0, 600, 400, cd)
buf = BytesIO(); prs.save(buf); buf.seek(0)
print(MarkItDown().convert_stream(buf, stream_info=StreamInfo(extension=".pptx")).markdown)

expected

missing points render as empty cells.

env: main 945314a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions