Medium Widget Support

This commit is contained in:
Benny 2020-10-23 10:05:06 +02:00 committed by GitHub
parent 7f9cb415e4
commit d20fad4f24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,10 @@ Credits:
// How many minutes should the cache be valid // How many minutes should the cache be valid
const cacheMinutes = 60 * 2; const cacheMinutes = 60 * 2;
const population = 646000; const population = 646000;
const daysInGraph = 14;
// Show days in graph based on widget size
const daysInGraph = (config.widgetFamily === 'small')? 14 : 28;
const graphWidh = (config.widgetFamily === 'small')? 400 : 800;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
let backColor; //Widget background color let backColor; //Widget background color
@ -120,8 +123,9 @@ covidText.centerAlignText()
widget.addSpacer() widget.addSpacer()
let image = columnGraph(data["graph"], 400, 50, new Color(graphColor)).getImage() let image = columnGraph(data["graph"], graphWidh, 50, new Color(graphColor)).getImage()
widget.addImage(image) let graph = widget.addImage(image)
graph.centerAlignImage()
widget.addSpacer(5) widget.addSpacer(5)