Skip to content

Function: isChartType() ​

isChartType(name): name is "area" | "line" | "bar" | "bar3D" | "bubble" | "bubble3D" | "doughnut" | "pie" | "radar" | "scatter" | "stock" | "surface" | "waterfall" | "funnel" | "treemap" | "sunburst" | "histogram" | "pareto" | "boxWhisker" | "regionMap"

Is name a chart type this library emits?

CHART_NAME constrains TypeScript callers, but addChart is reachable from plain JavaScript where nothing enforces the union — and the two emitters partition the catalog between them by switch, so an off-catalog string has no arm in either and cannot produce a plot. Checked once at define time (gen/define/chart.ts) so the caller hears about it at the call that was wrong, rather than getting a chart-shaped hole in the deck.

Parameters ​

ParameterType
nameunknown

Returns ​

name is "area" | "line" | "bar" | "bar3D" | "bubble" | "bubble3D" | "doughnut" | "pie" | "radar" | "scatter" | "stock" | "surface" | "waterfall" | "funnel" | "treemap" | "sunburst" | "histogram" | "pareto" | "boxWhisker" | "regionMap"