Change the timescale legend to be more readable instead of dense
This commit is contained in:
parent
4a7c03307d
commit
0c9e7ed183
14
src/index.js
14
src/index.js
@ -86,6 +86,9 @@ function populateChart() {
|
|||||||
size: 18,
|
size: 18,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
time: {
|
||||||
|
unit: lookupTimeUnit(currentTimeSelection)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
ticks: {
|
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() {
|
async function callUpdateURL() {
|
||||||
let resp = await fetch("https://data.wowtoken.app/token/current.json");
|
let resp = await fetch("https://data.wowtoken.app/token/current.json");
|
||||||
|
Loading…
Reference in New Issue
Block a user