Class: BaseChart<TEventsTypes>
Type parameters
Name | Type |
---|---|
TEventsTypes | BaseChartEventsTypes |
Hierarchy
Properties
svg
• Protected
Optional
svg: Svg
Defined in
container
• Protected
Readonly
container: Element
Defined in
eventEmitter
• Protected
Readonly
eventEmitter: EventEmitter
Defined in
initializeTimeoutId
• Private
initializeTimeoutId: null
| Timer
Defined in
optionsProvider
• Private
Optional
optionsProvider: OptionsProvider
<Options
<AxisOptions
, AxisOptions
>>
Defined in
data
• Protected
data: Data
<AllSeriesTypes
>
Defined in
Methods
resizeListener
▸ Private
Readonly
resizeListener(): this
Returns
this
Defined in
createChart
▸ Abstract
createChart(options
): void
Parameters
Name | Type |
---|---|
options | Options <AxisOptions , AxisOptions > |
Returns
void
Defined in
update
▸ update(data?
, options?
, override?
): BaseChart
<TEventsTypes
>
Updates the chart which currently does a full reconstruction of the SVG DOM
Parameters
Name | Type | Default value | Description |
---|---|---|---|
data? | Data <AllSeriesTypes > | undefined | Optional 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 > | undefined | Optional 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. |
override | boolean | false | If 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
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
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
Name | Type |
---|---|
T | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
event | T | Name of the event. Check the examples for supported events. |
listener | EventListener <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
▸ on(event
, listener
): BaseChart
<TEventsTypes
>
Parameters
Name | Type |
---|---|
event | "*" |
listener | AllEventsListener <any > |
Returns
BaseChart
<TEventsTypes
>
Defined in
▸ on(event
, listener
): BaseChart
<TEventsTypes
>
Parameters
Name | Type |
---|---|
event | string |
listener | EventListener <any > |
Returns
BaseChart
<TEventsTypes
>
Defined in
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
Name | Type |
---|---|
T | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
event | T | Name 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
▸ off(event
, listener?
): BaseChart
<TEventsTypes
>
Parameters
Name | Type |
---|---|
event | "*" |
listener? | AllEventsListener <any > |
Returns
BaseChart
<TEventsTypes
>
Defined in
▸ off(event
, listener?
): BaseChart
<TEventsTypes
>
Parameters
Name | Type |
---|---|
event | string |
listener? | EventListener <any > |
Returns
BaseChart
<TEventsTypes
>
Defined in
initialize
▸ initialize(): void
Returns
void
Defined in
Constructors
constructor
• new BaseChart<TEventsTypes
>(query
, data
, defaultOptions
, options
, responsiveOptions?
)
Type parameters
Name | Type |
---|---|
TEventsTypes | BaseChartEventsTypes <CreatedEvent <Options <AxisOptions , AxisOptions >>, DrawEvent > |
Parameters
Name | Type |
---|---|
query | null | string | Element |
data | Data <AllSeriesTypes > |
defaultOptions | Options <AxisOptions , AxisOptions > |
options | Options <AxisOptions , AxisOptions > |
responsiveOptions? | ResponsiveOptions <Options <AxisOptions , AxisOptions >> |