type Meta = anyAnything you attach to a series or value as meta, such as a tooltip text. Chartist doesn't read it: it hands it back in events and writes it to the ct:meta attribute.
type Multi = { x: number | string | Date | null; y: number | string | Date | null } | { x: number | string | Date | null } | { y: number | string | Date | null }A value with coordinates: { x, y }, or only x or y. Line charts draw { x, y } values on two scale axes (scatter plots).
type NormalizedMulti = { x: number; y: number } | { x: number } | { y: number }A Multi value after normalizing: its coordinates as numbers.
type Label = string | number | DateA label of an axis step or a pie slice.
type AllSeriesTypes = FlatSeries | (Series | SeriesObject)[]Every shape series can take: a FlatSeries (pies, distributed bars), or a list of Series arrays and SeriesObjects.
interface Data<T extends AllSeriesTypes = AllSeriesTypes>Chart data: the series, and labels for the positions of their values (or for the slices of a pie).
type Series<T = SeriesPrimitiveValue> = SeriesValue<T>[]A series as an array of values: [5, 2, 4]. Use a SeriesObject to give it a name, class name or meta.
interface SeriesObject<T = SeriesPrimitiveValue>A series with a name, class name or meta: { name: 'Sales', data: [5, 2, 4] }.
Properties
name?stringThe series' name. Line charts look up per-series options in
seriesby it.className?stringA class name for the series' group, instead of
ct-series-a,-b, …meta?anyAnything to attach to the series, handed back in events.
dataSeriesValue<T>[]The series' values.
type SeriesValue<T = SeriesPrimitiveValue> = SeriesObjectValue<T> | TA value of a series: a plain value, or { value, meta }.
type SeriesPrimitiveValue = number | string | boolean | Date | Multi | null | undefinedA plain value of a series: a number (numeric strings are read as numbers), a Multi { x, y }, or null or undefined for a hole.
interface SeriesObjectValue<T = SeriesPrimitiveValue>A value with meta: { value: 5, meta: 'Tuesday' }.
type FlatSeries<T = FlatSeriesPrimitiveValue> = FlatSeriesValue<T>[]One flat array of values, one per slice or bar: the series of a pie chart, or of a bar chart with distributeSeries.
type FlatSeriesValue<T = FlatSeriesPrimitiveValue> = SeriesValue<T> | FlatSeriesObjectValue<T>A value of a FlatSeries: a plain value, { value, meta }, or a FlatSeriesObjectValue with a name and class name for its slice.
type FlatSeriesPrimitiveValue = number | string | null | undefinedA plain value of a FlatSeries: a number (numeric strings are read as numbers), or null or undefined for a hole.
interface FlatSeriesObjectValue<T = FlatSeriesPrimitiveValue>A value of a flat series that is its own series, such as a pie slice: { value: 20, name: 'Rent', className: 'rent' }.
Properties
name?stringThe name of the value's series.
className?stringA class name for the value's series group, such as a slice's.
meta?anyAnything to attach to the value, handed back in events.
valueTThe value.
type AllNormalizedSeriesTypes = NormalizedFlatSeries | NormalizedSeries[]Every shape a normalized series can take: a NormalizedFlatSeries or a list of NormalizedSeries.
interface NormalizedData<T extends AllNormalizedSeriesTypes = AllNormalizedSeriesTypes> extends DataChart data after normalizeData: labels filled in, and every series an array of numbers, { x, y } numbers or holes.
type NormalizedSeries = NormalizedSeriesValue[]A series after normalizing: its values without meta or series object.
type NormalizedSeriesValue = NormalizedSeriesPrimitiveValueA normalized value: a number, { x, y } numbers, or undefined for a hole.
type NormalizedSeriesPrimitiveValue = number | NormalizedMulti | undefinedA normalized value: a number, { x, y } numbers, or undefined for a hole.
type NormalizedFlatSeries = number[]A FlatSeries after normalizing: one number per slice or bar.