read

Draw a chart in the conversation. Use it whenever the answer is a shape rather than a number: a trend over time, a compa

Draw a chart in the conversation. Use it whenever the answer is a shape rather than a number: a trend over time, a comparison across products or campaigns, a split of a total, a relationship between two measures. Prefer a chart to a markdown table for anything with more than about five rows of numbers, and always pass the figures you actually read from a tool — never invent or round data to make a nicer picture. Pick the kind by the question: line/area for a value over time; bar for magnitude across categories; stacked_bar or stacked_area when the TOTAL is also a real quantity; pie or donut for one whole split into a few parts; scatter for two measures against each other; combo for one measure as bars with another as a line. There is no dual-axis chart on purpose — two measures of very different scale go in two charts. ALWAYS set unit (and currency when it is money): a currency drawn as a bare number is a figure the merchant will read as the wrong thing. ALWAYS set source with the tool you read, the window, and the row count, so the merchant can trace the number back. At most 6 series; if you have more, chart the ones that matter and say so. Write a one-line answer in prose as well — the chart supports the sentence, it does not replace it.

post/api/v1/tools/render_chart

Request

  • Base URL: https://app.magistry.io
  • URL: https://app.magistry.io/api/v1/tools/render_chart
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.magistry.io/api/oauth/authorize, token URL https://app.magistry.io/api/oauth/token, scopes: read)

Request body

kind'line' | 'bar' | 'area' | 'stacked_bar' | 'stacked_area' | 'pie' | 'donut' | 'scatter' | 'combo' required

Chosen by the question the data answers, not by preference.

dataobject[] required

The rows, each an object. Every yKey must be a NUMBER in every row it appears in; use null for a genuinely missing point rather than 0, which is a measurement.

xKeystring required

The field on the x axis (or the slice name for pie/donut).

yKeysstring[] required

The measures to plot. Six at most — the series palette has six slots and is never reused.

labelsobject

Display names keyed by raw field name, e.g. {"rev":"Revenue","d":"Day"}.

titlestring

What the chart shows, as a short noun phrase.

subtitlestring

The window, the filter, or the caveat. One line.

unit'number' | 'currency' | 'percent' | 'duration_s' | 'compact'

How to format values. Percentages are whole numbers (12.5 means 12.5%), not fractions.

currencystring

ISO 4217, when unit is currency. e.g. EUR, GBP, USD.

barKeysstring[]

combo only: which series are bars.

lineKeysstring[]

combo only: which series are the line.

Response

Tool result

okboolean required
resultunknown required

Changes

No recorded changes to this operation across all 3 revisions of this API.