Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fixup: hide 0 precipit labels
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Jul 12, 2021
1 parent 8e8280d commit 0f78d00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weather-card-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
},
},
Expand Down

0 comments on commit 0f78d00

Please sign in to comment.