mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-07 05:57:41 +00:00
Medium Widget Support
This commit is contained in:
parent
7f9cb415e4
commit
d20fad4f24
1 changed files with 7 additions and 3 deletions
|
@ -10,7 +10,10 @@ Credits:
|
|||
// How many minutes should the cache be valid
|
||||
const cacheMinutes = 60 * 2;
|
||||
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
|
||||
|
@ -120,8 +123,9 @@ covidText.centerAlignText()
|
|||
|
||||
widget.addSpacer()
|
||||
|
||||
let image = columnGraph(data["graph"], 400, 50, new Color(graphColor)).getImage()
|
||||
widget.addImage(image)
|
||||
let image = columnGraph(data["graph"], graphWidh, 50, new Color(graphColor)).getImage()
|
||||
let graph = widget.addImage(image)
|
||||
graph.centerAlignImage()
|
||||
|
||||
widget.addSpacer(5)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue