mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +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
|
* `custom` attribute of elements was removed. Please use scriptable options
|
||||||
* The `zeroLine*` options of axes were removed.
|
* 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
|
### Options
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ helpers.extend(DatasetController.prototype, {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_resolveDatasetElementOptions: function(hover) {
|
_resolveDatasetElementOptions: function(active) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var chart = me.chart;
|
var chart = me.chart;
|
||||||
var datasetOpts = me._config;
|
var datasetOpts = me._config;
|
||||||
@ -715,15 +715,15 @@ helpers.extend(DatasetController.prototype, {
|
|||||||
|
|
||||||
// Scriptable options
|
// Scriptable options
|
||||||
var context = {
|
var context = {
|
||||||
chart: chart,
|
chart,
|
||||||
dataset: me.getDataset(),
|
dataset: me.getDataset(),
|
||||||
datasetIndex: me.index,
|
datasetIndex: me.index,
|
||||||
hover: hover
|
active
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0, ilen = elementOptions.length; i < ilen; ++i) {
|
for (i = 0, ilen = elementOptions.length; i < ilen; ++i) {
|
||||||
key = elementOptions[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([
|
values[key] = resolve([
|
||||||
datasetOpts[readKey],
|
datasetOpts[readKey],
|
||||||
options[readKey]
|
options[readKey]
|
||||||
|
Loading…
Reference in New Issue
Block a user