Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit ba8a609

Browse files
committed
work on chart.js 2.9 compatiblity
1 parent 844e7f6 commit ba8a609

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

src/controllers/boxplot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ const defaults = {
2525
Chart.defaults.boxplot = Chart.helpers.merge({}, [Chart.defaults.bar, verticalDefaults, defaults]);
2626
Chart.defaults.horizontalBoxplot = Chart.helpers.merge({}, [Chart.defaults.horizontalBar, horizontalDefaults, defaults]);
2727

28+
if (Chart.defaults.global.datasets && Chart.defaults.global.datasets.bar) {
29+
Chart.defaults.global.datasets.boxplot = {...Chart.defaults.global.datasets.bar};
30+
}
31+
if (Chart.defaults.global.datasets && Chart.defaults.global.datasets.horizontalBar) {
32+
Chart.defaults.global.datasets.horizontalBoxplot = {...Chart.defaults.global.datasets.horizontalBar};
33+
}
34+
2835
const boxplot = {
2936
...base,
3037
dataElementType: Chart.elements.BoxAndWhiskers,

src/controllers/violin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ const defaults = {
2020
Chart.defaults.violin = Chart.helpers.merge({}, [Chart.defaults.bar, verticalDefaults, defaults]);
2121
Chart.defaults.horizontalViolin = Chart.helpers.merge({}, [Chart.defaults.horizontalBar, horizontalDefaults, defaults]);
2222

23+
if (Chart.defaults.global.datasets && Chart.defaults.global.datasets.bar) {
24+
Chart.defaults.global.datasets.violin = {...Chart.defaults.global.datasets.bar};
25+
}
26+
if (Chart.defaults.global.datasets && Chart.defaults.global.datasets.horizontalBar) {
27+
Chart.defaults.global.datasets.horizontalViolin = {...Chart.defaults.global.datasets.horizontalBar};
28+
}
29+
2330
const controller = {
2431
...base,
2532
dataElementType: Chart.elements.Violin,

src/scale/arrayLinear.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const ArrayLinearScale = Chart.scaleService.getScaleConstructor('linear').extend
1111
getRightValue(rawValue) {
1212
return Chart.LinearScaleBase.prototype.getRightValue.call(this, getRightValue(rawValue, this.options.ticks));
1313
},
14+
_parseValue(rawValue) {
15+
return Chart.LinearScaleBase.prototype._parseValue.call(this, getRightValue(rawValue, this.options.ticks));
16+
},
1417
determineDataLimits() {
1518
commonDataLimits.call(this);
1619
// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero

src/scale/arrayLogarithmic.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const ArrayLogarithmicScale = Chart.scaleService.getScaleConstructor('logarithmi
1212
getRightValue(rawValue) {
1313
return Chart.LinearScaleBase.prototype.getRightValue.call(this, getRightValue(rawValue, this.options.ticks));
1414
},
15+
_parseValue(rawValue) {
16+
return Chart.LinearScaleBase.prototype._parseValue.call(this, getRightValue(rawValue, this.options.ticks));
17+
},
1518
determineDataLimits() {
1619
// Add whitespace around bars. Axis shouldn't go exactly from min to max
1720
const tickOpts = this.options.ticks;

0 commit comments

Comments
 (0)