Show Chart

Show_Chart renders standard inline charts for simple exploratory visuals inside chat. It supports exactly 3 chart kinds: trend, comparison, and leaderboard.

When To Use

  • Use trend for ordered time or sequence data where caller-provided row order matters.

  • Use comparison for grouped vertical-bar comparisons across short categorical labels.

  • Use leaderboard for a single ranked metric shown as horizontal bars.

  • Do not use Show_Chart for bespoke graphics, heavy annotations, multi-panel layouts, or presentation polish. Use the shell graphics path for those cases.

Contract

  • Required top-level keys:

    • id

    • kind

    • rows

    • labelKey

    • series

  • Optional top-level keys:

    • title

    • description

    • fullLabelKey

    • valueFormat

    • maxItems

    • footnote

Row And Series Rules

  • Every row must contain the field named by labelKey.

  • If fullLabelKey is provided, every row must contain that field too.

  • Every series.key must exist in every row.

  • Every series.key value must be numeric.

  • Numeric values should be JSON numbers, not quoted strings like "12" or text like "N/A".

  • Validation failures should be fixed in the payload, not ignored or retried with the same shape.

Mode Behavior

  • trend

    • preserves caller-provided row order

    • supports 1-4 series

    • renders a standard line chart

    • does not auto-sort rows

  • comparison

    • preserves caller-provided row order

    • supports 1-4 series

    • renders grouped vertical bars

    • does not stack bars

  • leaderboard

    • requires exactly 1 series

    • sorts rows descending by that series key

    • applies maxItems after sorting

    • defaults maxItems to 10

    • renders ranked horizontal bars

valueFormat

  • valueFormat is an optional strict object, not a shorthand string.

  • Use "compact": true for large money or count values so axes and direct value labels remain readable in compact inline cards. Hover tooltips can still expose the full value.

  • Valid shape:

  • kind values:

    • number

    • currency

    • percent

  • basis values for percent formatting:

    • fraction

    • unit

Minimal Examples

Trend:

Comparison:

Leaderboard:

Rendering Constraints

  • Best for standard inline charts in chat, not custom-designed graphics.

  • Large currency and count charts should use compact magnitude formatting such as $2.4B, $844.4M, or 1.2K.

  • comparison is best when category labels are short enough to remain readable in grouped vertical bars.

  • leaderboard is the right inline choice for top-N ranked categories.

  • If the chart needs custom annotations, dense long-label art direction, multi-panel layout, or presentation styling, use the shell graphics path instead of Show_Chart.

Last updated

Was this helpful?