A chart-generation prompt should produce a machine-checkable spec, not only a picture and a persuasive caption. The spec records the input dataset version, field names and types, filters, aggregations, scale domains, threshold, missing-value rule, and output size. Keep raw data and transforms separate so a reviewer can recompute every mark. A rendered image is a view of that spec; it is not evidence that the transformation was correct. The application validates the spec against an allowlist of fields and operators before rendering. Store a content hash or immutable artifact ID for the exact input used.
Chart prompts: produce a reproducible spec and data lineage
Operational case
The C-47 chart packet names snapshot S-47 and a six-slot window. Its spec maps local hour to x, observed temperature to y, and a 5.0-degree threshold to a reference line. It rejects a model-proposed field called estimated_temperature because that field is not in the approved dataset. A late third-hour record later creates snapshot S-48 and a new chart version; the old report remains tied to S-47. The reviewer can compare the two versions without asking the model to remember how it drew the first one.
Input: snapshot S-47, six scheduled slots.
Fields: local_hour, observed_temperature_c, reading_status.
Transform: valid readings only for rate; missing slot retained as gap.
Encoding: hour -> x; temperature -> y; limit -> rule.
Reject unknown field: estimated_temperature_c.Performance and operating cost
Validating K spec fields and transforms is O(K), with a separate O(N) check against N source rows when recomputing marks. Storing one compact spec per version is inexpensive relative to keeping an unreviewable screenshot as the only artifact. A renderer can change appearance across releases, so preserve both spec version and rendered output ID when comparing. The prompt should not bury important transforms in free-form wording that a parser cannot verify.
Common Mistakes
- Do not accept a field the approved dataset does not contain.
- Do not replace source data lineage with a screenshot filename.
- Do not silently mutate an old chart when a late record arrives.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Prompt release artifacts: version the whole decision path
- Workbook prompts: name sheets, ranges, types, and provenance
- API examples: validate payloads and strip credentials
- Chart prompts: state the decision and measured quantity
- Chart prompts: choose marks and scales by data type
- Chart prompts: expose missing data and checked denominators
- Chart prompts: review rendered and nonvisual outputs
- Project: review a cold-chain temperature chart
- Chart-creation prompt decisions
