mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
parent
39172f8c49
commit
9dc33de49f
@ -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",
|
||||
|
@ -7,10 +7,10 @@
|
||||
// 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) {
|
||||
|
||||
// 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) {
|
||||
const getRange = {
|
||||
x: (a, b) => Math.abs(a.x - b.x),
|
||||
y: (a, b) => Math.abs(a.y - b.y),
|
||||
@ -62,15 +62,5 @@
|
||||
}
|
||||
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>
|
Loading…
x
Reference in New Issue
Block a user