AddThisFeature

AI Chart Recommendation

Recommend a chart that fits the selected fields instead of leaving the choice to guesswork.

moderate AI Analysis & Search

What it adds

A suggestion of chart type and encoding for the fields a user has picked, with a short reason drawn from the shape of the data.

What your agent is told to do

5
  1. 1

    Enumerate the chart types the app can actually render, with their real constraints on cardinality, field types, and series count. Give the model that catalogue and require it to choose from it.

  2. 2

    Profile the selected fields in the app before asking for a recommendation: types, distinct counts, null density, whether a field is a continuous time axis, and the row count. The model reasons about the profile, not the data itself.

  3. 3

    Present the recommendation as a proposal the user applies. Do not silently switch a chart the user has already configured, and keep their choice sticky once they have made one.

  4. 4

    Return a reason in terms of the data shape, such as too many distinct categories for a proportional chart. A recommendation with no stated reason cannot be argued with or learned from.

  5. 5

    Do not send the underlying rows to the model. A field profile is enough to pick a chart type, and shipping customer data to a provider to choose between a bar and a line is an unnecessary disclosure.

Edge cases it handles

8
  • A recommendation naming a chart type the app cannot render is worse than no recommendation. Validate the returned choice against the catalogue and fall back to the deterministic default when it does not match.
  • Some combinations are actively misleading and must be refused outright: a proportional chart across dozens of categories, a line across an unordered categorical axis, or a dual axis chosen to make two unrelated series appear correlated.
  • The explanation must reference the actual profile, naming the distinct count or the field type that drove the choice, rather than offering a generic statement about clarity.
  • A recommended chart still has to work at small widths, in both themes, and for a colour-blind reader. A type that needs a dozen distinguishable colours is not a valid recommendation regardless of what the model returns.
  • When no visualization improves on the raw values, recommend a table. Sparse data, a single row, or a metric with no meaningful axis reads better as numbers.
  • Set a token and time ceiling on the call and fall back to a deterministic rule set built from the same field profile. The user must never wait on a model to see a chart.
  • A malformed or partial structured response must be discarded whole. Do not apply the chart type from a response whose encoding fields failed to parse.
  • Recommendations must be recomputed when the field selection changes, and not left showing a reason about fields the user has since removed.

Definition of done

9
  • Recommendations are drawn only from chart types the app can render, and invalid returns fall back to a deterministic default.
  • The app profiles the selected fields locally and sends no underlying rows to the provider.
  • Known-misleading type and field combinations are refused.
  • Each recommendation states a reason referencing the concrete data shape.
  • A table is recommended when no chart improves comprehension.
  • The recommendation is a proposal the user applies, and never overwrites a chart they configured.
  • A model timeout or failure still produces a usable chart from deterministic rules.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.