Skip to main content

Class: BaseChart<TEventsTypes>

Type parameters

NameType
TEventsTypesBaseChartEventsTypes

Hierarchy

Properties

svg

Protected Optional svg: Svg

Defined in

charts/BaseChart.ts:11


container

Protected Readonly container: Element

Defined in

charts/BaseChart.ts:12


eventEmitter

Protected Readonly eventEmitter: EventEmitter

Defined in

charts/BaseChart.ts:13


initializeTimeoutId

Private initializeTimeoutId: null | Timer

Defined in

charts/BaseChart.ts:17


optionsProvider

Private Optional optionsProvider: OptionsProvider<Options<AxisOptions, AxisOptions>>

Defined in

charts/BaseChart.ts:21


data

Protected data: Data<AllSeriesTypes>

Defined in

charts/BaseChart.ts:25

Methods

resizeListener

Private Readonly resizeListener(): this

Returns

this

Defined in

charts/BaseChart.ts:14


createChart

Abstract createChart(options): void

Parameters

NameType
optionsOptions<AxisOptions, AxisOptions>

Returns

void

Defined in

charts/BaseChart.ts:53


update

update(data?, options?, override?): BaseChart<TEventsTypes>

Updates the chart which currently does a full reconstruction of the SVG DOM

Parameters

NameTypeDefault valueDescription
data?Data<AllSeriesTypes>undefinedOptional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.
options?Options<AxisOptions, AxisOptions>undefinedOptional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.
overridebooleanfalseIf set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:67


detach

detach(): BaseChart<TEventsTypes>

This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:110


on

on<T>(event, listener): BaseChart<TEventsTypes>

Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.

Type parameters

NameType
Textends string | number | symbol

Parameters

NameTypeDescription
eventTName of the event. Check the examples for supported events.
listenerEventListener<TEventsTypes[T]>The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:130

on(event, listener): BaseChart<TEventsTypes>

Parameters

NameType
event"*"
listenerAllEventsListener<any>

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:134

on(event, listener): BaseChart<TEventsTypes>

Parameters

NameType
eventstring
listenerEventListener<any>

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:135


off

off<T>(event, listener?): BaseChart<TEventsTypes>

Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.

Type parameters

NameType
Textends string | number | symbol

Parameters

NameTypeDescription
eventTName of the event for which a handler should be removed
listener?EventListener<TEventsTypes[T]>The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:147

off(event, listener?): BaseChart<TEventsTypes>

Parameters

NameType
event"*"
listener?AllEventsListener<any>

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:151

off(event, listener?): BaseChart<TEventsTypes>

Parameters

NameType
eventstring
listener?EventListener<any>

Returns

BaseChart<TEventsTypes>

Defined in

charts/BaseChart.ts:152


initialize

initialize(): void

Returns

void

Defined in

charts/BaseChart.ts:159

Constructors

constructor

new BaseChart<TEventsTypes>(query, data, defaultOptions, options, responsiveOptions?)

Type parameters

NameType
TEventsTypesBaseChartEventsTypes<CreatedEvent<Options<AxisOptions, AxisOptions>>, DrawEvent>

Parameters

NameType
querynull | string | Element
dataData<AllSeriesTypes>
defaultOptionsOptions<AxisOptions, AxisOptions>
optionsOptions<AxisOptions, AxisOptions>
responsiveOptions?ResponsiveOptions<Options<AxisOptions, AxisOptions>>

Defined in

charts/BaseChart.ts:23