Give exported images an auditable data table and a compact manifest of the choices that produced them.
Chart exports: carry the data, filters and render contract together
An image is not the full evidence
A PNG captures pixels; it does not preserve the records, filter predicates, missingness states or exact values behind them. SVG retains scalable geometry, but it can still omit the underlying analytical contract. For a decision-grade chart, export an image, a machine-readable table of plotted values and a manifest describing the query and rendering choices. The package should answer which source snapshot, cohort, units, time zone, grouping rule, axis domain, palette and code version produced the picture. Dashboard provenance supplies these ingredients; export binds them to an artifact.
Version the plotted data product
A chart may use raw events, daily aggregates or a reduced display level. The export must name that level. Include a dataset snapshot or immutable revision, plus the report's as-of time when corrections are possible. A hash of canonical manifest bytes detects accidental changes to the manifest; it does not authenticate a source by itself. If integrity across systems matters, sign the package through a trusted release path. Never include private identifiers or unmasked rows merely because a chart view was authorized. Data classification still governs exports.
Keep visible and downloadable values aligned
The CSV or JSON table must use the same filters, denominator, sort, unit and missing-value policy as the displayed chart. If the chart shows rounded percentages, include underlying counts and unrounded rates in the data export while documenting the display rounding. A tooltip, table and image title should agree on the period and finalization status. Linked filters can change the cohort moments before a user clicks export; capture one state and one data version atomically for the whole package.
Make the visual portable and accessible
An SVG is useful for vector editing and high-resolution print, but font substitution and external styles can change its appearance. A PNG is more predictable but loses scale and selectable text. Include an accessible text summary and data table in either case. Document the output size, color profile where relevant, and the scale tick labels. Text alternatives should describe the main pattern, notable exceptions and uncertainty rather than repeat a generic chart title. For a public download, test that no hidden private series remain in SVG markup or embedded metadata.
Recreate before release
Re-run the export from its manifest in a clean environment. Compare plotted counts, axis limits, filters, title, source generation and checksum, allowing only declared rendering differences such as font rasterization. A changed query definition should make an old package non-reproducible by design; report that conflict instead of silently rendering with today's code. Keep an editorial preview for review, then publish an immutable artifact reference when the chart is used in a report or audit. Reduced series need the level and bucket rule in the manifest.
Worked contract
import hashlib
import json
def chart_manifest(query_id: str, dataset_version: str,
filters: dict[str, list[str]],
axis_domain: tuple[float, float],
plotted_rows: int) -> tuple[dict, str]:
if not query_id or not dataset_version or plotted_rows < 0:
raise ValueError("missing chart identity")
if axis_domain[0] >= axis_domain[1]:
raise ValueError("invalid axis domain")
manifest = {
"query_id": query_id,
"dataset_version": dataset_version,
"filters": {key: sorted(set(values))
for key, values in sorted(filters.items())},
"y_axis_domain": list(axis_domain),
"plotted_rows": plotted_rows,
"unit": "minutes",
"render_contract": "depot-delay-v3",
}
payload = json.dumps(manifest, sort_keys=True, separators=(",", ":"),
ensure_ascii=False).encode("utf-8")
return manifest, hashlib.sha256(payload).hexdigest()
first = chart_manifest("depot-delay-week", "snapshot-81",
{"region": ["north", "north"]}, (0, 47), 31)
second = chart_manifest("depot-delay-week", "snapshot-81",
{"region": ["north"]}, (0, 47), 31)
assert first == second and len(first[1]) == 64Performance and operating cost
For F total filter values and M serialized manifest bytes, sorting normalized filters costs O(F log F) in the worst case; JSON encoding and SHA-256 hashing take O(M) time and O(M) temporary memory. Exporting an image or plotted data can cost much more and depends on the renderer and row count. This hash identifies equal manifest bytes, not equal pixels or trustworthy provenance. Add a data-file checksum and a signed release record when the export package crosses a trust boundary.
Common Mistakes
- Publishing only a screenshot when reviewers need the plotted data and cohort definition.
- Exporting a CSV from a stale filter state while the chart shows a newer selection.
- Assuming a manifest hash proves who created the data.
- Embedding hidden private rows in an otherwise public SVG or HTML export.
Validation drill
Export one filtered depot-delay chart as SVG and CSV with a manifest. Change only the filter and verify the manifest digest changes, then rebuild the original chart from its saved version and compare counts and axis bounds.
Read next
- Dashboard filters and provenance: make every view reproducible
- Interactive dashboards: recompute cohorts after linked filters
- Accessible charts: encode meaning without relying on color alone
- Large chart series: reduce marks without erasing spikes
Continue this visualization path
- Waterfall charts: reconcile every step to the closing total
- Dual-axis charts: test whether two series really need one plot
- Probability calibration plots: compare predicted risk with observed frequency
- Tornado charts: keep scenario ranges attached to their assumptions
- Embedding scatterplots: audit neighborhoods before naming clusters
- Spectrograms: make time, frequency and color scales defensible
- Marimekko charts: make width, height and area reconcile
