Read a parse’s charts
This example parses a report, then reads its charts and saves them as Excel and CSV files:async: true and poll the job: see Jobs and results. An expired or deleted parse gets 400 or 410: parse the document again.
What Charts reads
EachFigure element on the pages you select that is a chart becomes one entry in charts:
- In a PDF or image, Charts reads the figure’s pixels and keeps up to
data_pointspoints per series, with aconfidencefrom 0 to 1. - In an Excel workbook (
.xlsxor.xlsm), it reads the workbook’s own chart data: every point, exactly, withconfidence: null. Charts in an.xlsworkbook are skipped.
Charts reads a Word, PowerPoint or HTML document’s charts from the figure images saved with the parse, as for a PDF, so parse it with
enhancements.figures.include: true. Without them, Charts skips every figure in the document.layout refine pass fixes that.
Choose options
All options inconfig are optional:
Read the result
GET /charts/{charts_id}/result (client.charts.get_result) returns the charts, in the order of their figures, and the export files:
data holds [x, y] points, and y is null where it couldn’t be read. An axis that couldn’t be calibrated has scale: "normalized" and values from 0 to 1: treat them as relative, not as the chart’s units.
The result’s warnings can include:
A
FIGURE_SKIPPED or FIGURE_FAILED message starts with the figure’s id, such as Figure-7. If the chart reader can’t be reached at all, the job fails with a 503 and isn’t billed. Run it again later.
Pricing
Charts costs 1 credit per chart returned. Skipped and failed figures and the export files cost nothing (Pricing).Next steps
Parse
Describe figures, save their images, and fix their layout.
Charts API reference
Every option, field and limit.