Compare commits

..

2 Commits

View File

@@ -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");
@@ -258,7 +272,7 @@ function detectRegionQuery(urlSearchParams) {
} }
} }
} else { } else {
console.log("An incorrect or malformed region selection was made in the query string"); console.warn("An incorrect or malformed region selection was made in the query string");
} }
} }
@@ -276,7 +290,7 @@ function detectTimeQuery(urlSearchParams) {
} }
} }
} else { } else {
console.log("An incorrect or malformed time selection was made in the query string"); console.warn("An incorrect or malformed time selection was made in the query string");
} }
} }
@@ -292,7 +306,7 @@ function detectAggregateQuery(urlSearchParams) {
} }
aggregateFunctionToggle(); aggregateFunctionToggle();
} else { } else {
console.log("An incorrect or malformed aggregate selection was made in the query string"); console.warn("An incorrect or malformed aggregate selection was made in the query string");
} }
} }