add si units close #52
This commit is contained in:
parent
94470db9a7
commit
af53cca45e
15 changed files with 204 additions and 57 deletions
|
|
@ -38,7 +38,7 @@ class HourlyGraph extends WeatherDisplay {
|
|||
const skyCover = data.map((d) => d.skyCover);
|
||||
|
||||
this.data = {
|
||||
skyCover, temperature, probabilityOfPrecipitation,
|
||||
skyCover, temperature, probabilityOfPrecipitation, temperatureUnit: data[0].temperatureUnit,
|
||||
};
|
||||
|
||||
this.setStatus(STATUS.loaded);
|
||||
|
|
@ -107,6 +107,9 @@ class HourlyGraph extends WeatherDisplay {
|
|||
// set the image source
|
||||
this.image.src = canvas.toDataURL();
|
||||
|
||||
// change the units in the header
|
||||
this.elem.querySelector('.temperature').innerHTML = `Temperature ${String.fromCharCode(176)}${this.data.temperatureUnit}`;
|
||||
|
||||
super.drawCanvas();
|
||||
this.finishDraw();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue