feat(dashboard): #192 include treemap of treasure chests
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m47s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 3m36s

This commit was merged in pull request #195.
This commit is contained in:
2025-06-20 21:28:47 +02:00
parent 3120c19669
commit 72869e5c68
6 changed files with 138 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
// Initialize the echarts instance based on the prepared dom
async function init() {
const element = document.getElementById('graph')
async function initMainChart() {
const element = document.getElementById('main-chart')
if (element === null) {
return;
}
@@ -9,7 +9,7 @@ async function init() {
var myChart = echarts.init(element);
try {
const response = await fetch("/dashboard/dataset");
const response = await fetch("/dashboard/main-chart");
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
@@ -24,15 +24,41 @@ async function init() {
const chart = myChart.setOption(option);
window.addEventListener('resize', function() {
myChart.resize();
});
myChart.resize();
});
console.log("initialized charts");
console.log("initialized main-chart");
} catch (error) {
console.error(error.message);
}
// Display the chart using the configuration items and data just specified.
}
init();
async function initTreasureChests() {
const element = document.getElementById('treasure-chests')
if (element === null) {
return;
}
var myChart = echarts.init(element);
try {
const response = await fetch("/dashboard/treasure-chests");
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
const option = await response.json();
const chart = myChart.setOption(option);
window.addEventListener('resize', function() {
myChart.resize();
});
console.log("initialized treasure-chests");
} catch (error) {
console.error(error.message);
}
}
initMainChart();
initTreasureChests();