mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Context compatibility with dataLabels (#6713)
* Context compatibility with dataLabels * document * THe + wording
This commit is contained in:
parent
a2bf51a73c
commit
9589953c02
@ -27,6 +27,7 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
|
||||
|
||||
* `custom` attribute of elements was removed. Please use scriptable options
|
||||
* The `zeroLine*` options of axes were removed.
|
||||
* The `hover` property of scriptable options `context` object was renamed to `active` to align it with the datalabels plugin.
|
||||
|
||||
### Options
|
||||
|
||||
|
@ -704,7 +704,7 @@ helpers.extend(DatasetController.prototype, {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_resolveDatasetElementOptions: function(hover) {
|
||||
_resolveDatasetElementOptions: function(active) {
|
||||
var me = this;
|
||||
var chart = me.chart;
|
||||
var datasetOpts = me._config;
|
||||
@ -715,15 +715,15 @@ helpers.extend(DatasetController.prototype, {
|
||||
|
||||
// Scriptable options
|
||||
var context = {
|
||||
chart: chart,
|
||||
chart,
|
||||
dataset: me.getDataset(),
|
||||
datasetIndex: me.index,
|
||||
hover: hover
|
||||
active
|
||||
};
|
||||
|
||||
for (i = 0, ilen = elementOptions.length; i < ilen; ++i) {
|
||||
key = elementOptions[i];
|
||||
readKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;
|
||||
readKey = active ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;
|
||||
values[key] = resolve([
|
||||
datasetOpts[readKey],
|
||||
options[readKey]
|
||||
|
Loading…
Reference in New Issue
Block a user