From 0f78d00f3643be0a21a3e31b8c8ca14d4c6b7369 Mon Sep 17 00:00:00 2001 From: Chris Browet Date: Mon, 12 Jul 2021 13:43:38 +0200 Subject: [PATCH] Fixup: hide 0 precipit labels --- weather-card-chart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weather-card-chart.js b/weather-card-chart.js index 197bd1c..cb66f38 100644 --- a/weather-card-chart.js +++ b/weather-card-chart.js @@ -421,7 +421,8 @@ class WeatherCardChart extends Polymer.Element { var meta = chartInstance.getDatasetMeta(2); meta.data.forEach(function (bar, index) { var data = (Math.round((chartInstance.data.datasets[2].data[index]) * 10) / 10).toFixed(1); - ctx.fillText(data, bar.x, bar.y - 5); + if (data > 0) + ctx.fillText(data, bar.x, bar.y - 5); }); }, },