From eaccd22267c769b6db971c823d7dbee701151c73 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 15:05:01 +0200 Subject: [PATCH] Fix chartjs deprecation warnings (#9261) --- src/components/state-history-chart-timeline.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/state-history-chart-timeline.js b/src/components/state-history-chart-timeline.js index 12fe3ca416..816425aa25 100644 --- a/src/components/state-history-chart-timeline.js +++ b/src/components/state-history-chart-timeline.js @@ -194,7 +194,10 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { invertOnOff, ]); } - datasets.push({ data: dataRow, entity_id: stateInfo.entity_id }); + datasets.push({ + data: dataRow, + entity_id: stateInfo.entity_id, + }); labels.push(entityDisplay); }); @@ -234,6 +237,9 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { fontStyle: "bold", }, }, + categoryPercentage: undefined, + barPercentage: undefined, + time: { format: undefined }, }, ], yAxes: [ @@ -242,10 +248,17 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { yaxe.maxWidth = yaxe.chart.width * 0.18; }, position: this._computeRTL ? "right" : "left", + categoryPercentage: undefined, + barPercentage: undefined, + time: { format: undefined }, }, ], }, }, + datasets: { + categoryPercentage: 0.8, + barPercentage: 0.9, + }, data: { labels: labels, datasets: datasets,