chartjs-plugin-annotation
plugin version 2 introduces a number of breaking changes. In order to improve performance, offer new features, and improve maintainability, it was necessary to break backwards compatibility, but we aimed to do so only when worth the benefit.
A number of changes were made to the configuration options passed to the plugin configuration. Those changes are documented below.
xScaleID
option default has been changed, now set toundefined
. If the option is missing, the plugin will try to use the first scale of the chart, configured as'x'
axis. If more than one scale has been defined in the chart as'x'
axis, the option is mandatory to select the right scale.yScaleID
option default has been changed, now set toundefined
. If the option is missing, the plugin will try to use the first scale of the chart, configured as'y'
axis. If more than one scale has been defined in the chart as'y'
axis, the option is mandatory to select the right scale.- When stacked scales are used, instead of the whole chart area, the designated scale area is used as fallback for
xMin
,xMax
,yMin
,yMax
,xValue
oryValue
options.
chartjs-plugin-annotation
plugin version 2 introduces the interaction
options, to configure which events trigger annotation interactions. By default, the plugin uses the chart interaction configuration.
- When scatter charts are used, the interaction default
mode
in Chart.js ispoint
, while, in the previous plugin version, the default wasnearest
.