Update chartjs to 2.7.2 (#963)

* Update chartjs to 2.7.2

* lint

* lint
This commit is contained in:
Boyi C 2018-03-04 09:43:27 +08:00 committed by Paulus Schoutsen
parent 39172f8c49
commit 9dc33de49f
2 changed files with 50 additions and 60 deletions

View File

@ -56,7 +56,7 @@
"vaadin-date-picker": "vaadin/vaadin-date-picker#^2.0.0",
"web-animations-js": "^2.2.5",
"webcomponentsjs": "^1.0.10",
"chart.js": "~2.7.1",
"chart.js": "~2.7.2",
"moment": "^2.20.0",
"chartjs-chart-timeline": "fanthos/chartjs-chart-timeline#^0.1.4",
"chartjs-plugin-zoom": "^0.6.3",

View File

@ -7,7 +7,7 @@
// Use minified(Chart.min.js) version to fix strange color after uglify
// eslint-disable-next-line no-unused-vars
/* global Chart moment Color Hammer */
{
// This function add a new interaction mode to Chart.js that
// returns one point for every dataset.
Chart.Interaction.modes.neareach = function (chart, e, options) {
@ -63,14 +63,4 @@
const ret = elements.filter(n => n !== undefined);
return ret;
};
// Fix infinite loop bug in Chart.js 2.7.1
const x = Chart.scaleService.constructors.time.prototype;
x._getLabelCapacity = x.getLabelCapacity;
x.getLabelCapacity = function () {
// eslint-disable-next-line prefer-rest-params
const ret = this._getLabelCapacity.apply(this, arguments);
return ret > 0 ? ret : 1;
};
}
</script>