Filtered out expansions in owned game list. Owned game statistic uses day steps

This commit is contained in:
Yarne Coppens 2024-08-12 09:09:39 +02:00
parent 8036276187
commit 06e1599461
2 changed files with 7 additions and 6 deletions

View file

@ -84,7 +84,7 @@ async function loadOwnedGames() {
var boardgame_datatable = new DataTable('.boardgame_table', {
ajax: {
url: api_url + '/owned',
url: api_url + '/owned?filter_expansions_out=true',
dataSrc: ''
},
columns: [
@ -139,21 +139,22 @@ async function loadOwnedGames() {
async function loadStatistics(){
const overtimechart = document.getElementById("overtimechart")
games_over_time_statistic = await makeRequest(api_url + '/statistics/amount_of_games_over_time')
games_over_time_statistic = await makeRequest(api_url + '/statistics/amount_of_games_over_time?day_step=30')
console.log(games_over_time_statistic)
console.log(Object.keys(games_over_time_statistic.result))
console.log(Object.values(games_over_time_statistic.result))
new Chart(overtimechart, {
type: 'bar',
type: 'line',
data: {
labels: Object.keys(games_over_time_statistic.result),
datasets: [{
label: '# of Games',
label: games_over_time_statistic.name,
data: Object.values(games_over_time_statistic.result),
borderWidth: 1
}]
},
]
},
options: {
scales: {