commit 0c9e7ed1833ca79a020a480b395ed20af85838a0
parent 4a7c03307d7a01eb090104ad785101fc2fea403e
Author: Emily Doherty <git@emily.sh>
Date: Fri, 12 Apr 2024 05:27:41 -0700
Change the timescale legend to be more readable instead of dense
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/index.js b/src/index.js
@@ -86,6 +86,9 @@ function populateChart() {
size: 18,
}
},
+ time: {
+ unit: lookupTimeUnit(currentTimeSelection)
+ }
},
y: {
ticks: {
@@ -100,6 +103,17 @@ function populateChart() {
});
}
+function lookupTimeUnit(query){
+ const lookup = {
+ 'h': 'day',
+ 'd': 'week',
+ 'm': 'month',
+ 'y': 'month',
+ 'l': 'year'
+ }
+ return lookup[query.charAt(query.length - 1)]
+}
+
async function callUpdateURL() {
let resp = await fetch("https://data.wowtoken.app/token/current.json");