public interface Plugin
Modifier and Type | Method and Description |
---|---|
String |
getId()
Plugins must define a unique id in order to be configurable.
Returns the plugin id. |
default void |
onAfterBuildTicks(IsChart chart,
PluginScaleArgument argument)
Called after scale has build its ticks.
This hook is called separately for each scale in the chart. |
default void |
onAfterDataLimits(IsChart chart,
PluginScaleArgument argument)
Called after scale data limits are calculated.
This hook is called separately for each scale in the chart. |
default void |
onAfterDatasetDraw(IsChart chart,
PluginDatasetArgument item)
Called after the 'chart' datasets at the given 'args.index' have been drawn (datasets are drawn in the reverse order).
Note that this hook will not be called if the datasets drawing has been previously cancelled. |
default void |
onAfterDatasetsDraw(IsChart chart)
Called after the 'chart' datasets have been drawn.
Note that this hook will not be called if the datasets drawing has been previously cancelled. |
default void |
onAfterDatasetsUpdate(IsChart chart,
PluginUpdateArgument argument)
Called after the 'chart' datasets have been updated.
Note that this hook will not be called if the datasets update has been previously cancelled. |
default void |
onAfterDatasetUpdate(IsChart chart,
PluginDatasetArgument item)
Called after the 'chart' datasets at the given 'args.index' has been updated.
Note that this hook will not be called if the datasets update has been previously cancelled. |
default void |
onAfterDraw(IsChart chart)
Called after the 'chart' has been drawn.
Note that this hook will not be called if the drawing has been previously cancelled. |
default void |
onAfterEvent(IsChart chart,
PluginEventArgument argument)
Called after the 'event' has been consumed.
Note that this hook will not be called if the 'event' has been previously discarded. |
default void |
onAfterInit(IsChart chart,
Chart nativeChart)
Called after 'chart' has been initialized and before the first update.
|
default void |
onAfterLayout(IsChart chart)
Called after the 'chart' has been layed out.
Note that this hook will not be called if the layout update has been previously cancelled. |
default void |
onAfterRender(IsChart chart)
Called after the 'chart' has been fully rendered (and animation completed).
Note that this hook will not be called if the rendering has been previously cancelled. |
default void |
onAfterTooltipDraw(IsChart chart,
PluginTooltipArgument item)
Called after drawing the 'tooltip'.
Note that this hook will not be called if the tooltip drawing has been previously cancelled. |
default void |
onAfterUpdate(IsChart chart,
PluginUpdateArgument argument)
Called after 'chart' has been updated and before rendering.
Note that this hook will not be called if the chart update has been previously cancelled. |
default void |
onBeforeBuildTicks(IsChart chart,
PluginScaleArgument argument)
Called before scale builds its ticks.
This hook is called separately for each scale in the chart. |
default void |
onBeforeDataLimits(IsChart chart,
PluginScaleArgument argument)
Called before scale data limits are calculated.
This hook is called separately for each scale in the chart. |
default boolean |
onBeforeDatasetDraw(IsChart chart,
PluginDatasetArgument item)
Called before drawing the 'chart' dataset at the given 'args.index' (datasets are drawn in the reverse order).
If any plugin returns false , the datasets drawing is cancelled until another 'render' is triggered. |
default boolean |
onBeforeDatasetsDraw(IsChart chart)
Called before drawing the 'chart' datasets.
|
default boolean |
onBeforeDatasetsUpdate(IsChart chart,
PluginUpdateArgument argument)
Called before updating the 'chart' datasets.
If any plugin returns false , the datasets update is cancelled until another 'update' is triggered. |
default boolean |
onBeforeDatasetUpdate(IsChart chart,
PluginDatasetArgument item)
Called before updating the 'chart' dataset at the given 'args.index'.
If any plugin returns false , the datasets update is cancelled until another 'update' is triggered. |
default boolean |
onBeforeDraw(IsChart chart)
Called before drawing 'chart' at every animation frame.
If any plugin returns false , the frame drawing is cancelled until another 'render' is triggered. |
default void |
onBeforeElementsUpdate(IsChart chart)
Called during the update process, before any chart elements have been created.
|
default boolean |
onBeforeEvent(IsChart chart,
PluginEventArgument argument)
Called before processing the specified 'event'.
If any plugin returns false , the event will be discarded. |
default void |
onBeforeInit(IsChart chart)
Called before initializing 'chart'.
|
default boolean |
onBeforeLayout(IsChart chart)
Called before laying out 'chart'.
If any plugin returns false , the layout update is cancelled until another 'update' is triggered. |
default boolean |
onBeforeRender(IsChart chart)
Called before rendering 'chart'.
|
default boolean |
onBeforeTooltipDraw(IsChart chart,
PluginTooltipArgument item)
Called before drawing the 'tooltip'.
If any plugin returns false , the tooltip drawing is cancelled until another 'render' is triggered. |
default boolean |
onBeforeUpdate(IsChart chart,
PluginUpdateArgument argument)
Called before updating 'chart'.
If any plugin returns false , the update is cancelled (and thus subsequent render(s)) until another 'update' is triggered. |
default void |
onBeginDrawing(IsChart chart,
boolean overridePreviousUpdate)
Called before every drawing cycle, coming from initialization, updating or rendering of chart.
|
default void |
onConfigure(IsChart chart)
Called before initializing configuration of 'chart'.
|
default void |
onDestroy(IsChart chart)
Called after the chart as been destroyed.
|
default void |
onEndDrawing(IsChart chart)
Called after every drawing cycle, coming from initialization, updating or rendering of chart.
|
default void |
onInstall(IsChart chart)
Called when plugin is installed for this chart instance.
This hook is also invoked for disabled plugins (options equals to false). |
default void |
onReset(IsChart chart)
Called during chart reset.
|
default void |
onResize(IsChart chart,
PluginResizeArgument argument)
Called after the chart as been resized.
|
default void |
onStart(IsChart chart)
Called when a plugin is starting.
This happens when chart is created or plugin is enabled. |
default void |
onStop(IsChart chart)
Called when a plugin stopping.
This happens when chart is destroyed or plugin is disabled. |
default void |
onUninstall(IsChart chart)
Called after chart is destroyed on all plugins that were installed for that chart.
This hook is also invoked for disabled plugins (options equals to false). |
String getId()
default void onConfigure(IsChart chart)
chart
- the chart instance.default void onBeginDrawing(IsChart chart, boolean overridePreviousUpdate)
chart
- the chart instanceoverridePreviousUpdate
- if true
the drawing was already running.default void onEndDrawing(IsChart chart)
chart
- the chart instancedefault void onBeforeInit(IsChart chart)
chart
- the chart instance.default void onAfterInit(IsChart chart, Chart nativeChart)
chart
- the chart instance.nativeChart
- CHART.JS chart instancedefault boolean onBeforeUpdate(IsChart chart, PluginUpdateArgument argument)
false
, the update is cancelled (and thus subsequent render(s)) until another 'update' is triggered.chart
- the chart instance.argument
- the argument passed for updatefalse
to cancel the chart update.default void onAfterUpdate(IsChart chart, PluginUpdateArgument argument)
chart
- the chart instance.argument
- the argument passed for updatedefault void onBeforeElementsUpdate(IsChart chart)
chart
- the chart instance.default boolean onBeforeLayout(IsChart chart)
false
, the layout update is cancelled until another 'update' is triggered.chart
- the chart instance.false
to cancel the chart layout.default void onAfterLayout(IsChart chart)
chart
- the chart instance.default boolean onBeforeDatasetsUpdate(IsChart chart, PluginUpdateArgument argument)
false
, the datasets update is cancelled until another 'update' is triggered.chart
- the chart instance.argument
- the argument passed for updatefalse
to cancel the datasets update.default void onAfterDatasetsUpdate(IsChart chart, PluginUpdateArgument argument)
chart
- the chart instance.argument
- the argument passed for updatedefault boolean onBeforeDatasetUpdate(IsChart chart, PluginDatasetArgument item)
false
, the datasets update is cancelled until another 'update' is triggered.chart
- the chart instance.item
- the dataset item.false
to cancel the chart datasets drawing.default void onAfterDatasetUpdate(IsChart chart, PluginDatasetArgument item)
chart
- the chart instance.item
- the dataset item.default boolean onBeforeRender(IsChart chart)
false
, the rendering is cancelled until another 'render' is triggered.chart
- the chart instance.false
to cancel the chart rendering.default void onAfterRender(IsChart chart)
chart
- the chart instance.default boolean onBeforeDraw(IsChart chart)
false
, the frame drawing is cancelled until another 'render' is triggered.chart
- the chart instance.false
to cancel the chart drawing.default void onAfterDraw(IsChart chart)
chart
- the chart instance.default boolean onBeforeDatasetsDraw(IsChart chart)
false
, the datasets drawing is cancelled until another 'render' is triggered.chart
- the chart instance.false
to cancel the chart datasets drawing.default void onAfterDatasetsDraw(IsChart chart)
chart
- the chart instance.default boolean onBeforeDatasetDraw(IsChart chart, PluginDatasetArgument item)
false
, the datasets drawing is cancelled until another 'render' is triggered.chart
- the chart instance.item
- the dataset item.false
to cancel the chart datasets drawing.default void onAfterDatasetDraw(IsChart chart, PluginDatasetArgument item)
chart
- the chart instance.item
- the dataset item.default boolean onBeforeTooltipDraw(IsChart chart, PluginTooltipArgument item)
false
, the tooltip drawing is cancelled until another 'render' is triggered.chart
- the chart instance.item
- The tooltip instance.false
to cancel the chart tooltip drawing.default void onAfterTooltipDraw(IsChart chart, PluginTooltipArgument item)
chart
- the chart instance.item
- The tooltip instance.default boolean onBeforeEvent(IsChart chart, PluginEventArgument argument)
false
, the event will be discarded.chart
- the chart instance.argument
- instance which contains event contextfalse
to discard the event.default void onAfterEvent(IsChart chart, PluginEventArgument argument)
chart
- the chart instance.argument
- instance which contains event contextdefault void onResize(IsChart chart, PluginResizeArgument argument)
chart
- the chart instance.argument
- argument of method which contains the new canvas display size (eq. canvas.style width and height).default void onReset(IsChart chart)
chart
- the chart instance.default void onDestroy(IsChart chart)
chart
- the chart instance.default void onInstall(IsChart chart)
chart
- the chart instance.default void onStart(IsChart chart)
chart
- the chart instance.default void onStop(IsChart chart)
chart
- the chart instance.default void onUninstall(IsChart chart)
chart
- the chart instance.default void onBeforeDataLimits(IsChart chart, PluginScaleArgument argument)
chart
- the chart instance.argument
- argument of method which contains the scale instance.default void onAfterDataLimits(IsChart chart, PluginScaleArgument argument)
chart
- the chart instance.argument
- argument of method which contains the scale instance.default void onBeforeBuildTicks(IsChart chart, PluginScaleArgument argument)
chart
- the chart instance.argument
- argument of method which contains the scale instance.default void onAfterBuildTicks(IsChart chart, PluginScaleArgument argument)
chart
- the chart instance.argument
- argument of method which contains the scale instance.