Prerequisites
- A completed parse job for a document that contains charts.
- The structured result, fetched with
get_structured_result, which is where chart data is exposed.
Find the charts
A chart is an element with theChart label. When its geometry was recovered, the element carries the digitized plot on chart_data. Walk the pages and collect the chart elements that have it.
Read the series and points
A chart’schart_data holds its series, and each series holds its points. Each point carries an x and a y in data units. When the x-axis is categorical, the chart also lists its categories, and a point’s x is the index into that list.
Read the recognized labels
The text on a chart, such as axis titles and data labels, is recovered onto the element’socr_text. Each entry carries the recognized text, its confidence, and a source of PdfText when it came from the document’s own text or Ocr when it was read from the image. Because ocr_text is a sibling of chart_data, it is present even on a chart whose geometry could not be digitized.
Python
Check confidence and warnings
Digitization is an estimate, and the chart records how much to trust it. Each chart carries anoverall_confidence and a warnings list. A warning is raised when a recognized value disagrees with the geometry, or when a series cannot be assigned to a left or right axis. Read both before treating the values as exact.
Python
Related
Charts, formulas, and vision models
How chart data is digitized and reconciled.
Output schema
The full chart data field definitions.