Interface ChartExport


public interface ChartExport

Chart Data Export

A FacetChart included in a data export does not export its raw fetched records — a facet key column plus a measure column whose header is a field name, where a count aggregated onto an id field reads as an ID rather than a tally. Instead the chart exports the table its chart conveys, in an export shape matched to the chart's semantics:
  • magnitude charts (column, bar, pie, doughnut, radar) export a ranked share-of-whole comparison: resolved labels, the measure named by its computation, percent of total, rank, and a Total row;
  • time series — line and area charts, and any chart whose primary facet is a date, datetime or time field — export chronologically with change-vs-prior columns, never ranked (ranking periods would destroy the chronology that is the chart's point);
  • scatter and bubble charts export one row per point: a leading identity column so outlying points can be named, then the raw X / Y / size values, unaggregated;
  • two-facet charts export a category-by-series matrix — one column per series value, a Total column, and, for stacked charts, a percentage block showing each cell's share of its row;
  • a distribution of the measure's values, bucketed into bins with cumulative percentages, is available on request.
The shape and its columns are inferred from the chart: its chartType, its facets' field types, and what the measure's aggregation makes valid — a summed Total over averages, or a running total of minimums, is never emitted, whatever is requested. FacetChart.chartExportSettings overrides any aspect: ChartExportShape picks the shape (including "raw" for the unreconstructed fetch) and the ChartExportSettings toggles add or remove individual columns.

All of this happens in the chart's getExportSpec() override, computed over a fresh fetch of the chart's own aggregation, so it applies wherever a chart is exported through Canvas.exportDescendantData() — and it is the shipped example of a component substituting a semantically richer export than its raw data.

See Also: