mirror of
https://github.com/sstent/GarminSync.git
synced 2026-01-27 01:21:40 +00:00
updated web interface - v3
This commit is contained in:
@@ -1,37 +1 @@
|
||||
// Initialize the activity progress chart
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Fetch activity stats from the API
|
||||
fetch('/api/activities/stats')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Create doughnut chart
|
||||
const ctx = document.getElementById('activityChart').getContext('2d');
|
||||
const chart = new Chart(ctx, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ['Downloaded', 'Missing'],
|
||||
datasets: [{
|
||||
data: [data.downloaded, data.missing],
|
||||
backgroundColor: ['#28a745', '#dc3545'],
|
||||
borderWidth: 1
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'top',
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Activity Status'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching activity stats:', error);
|
||||
});
|
||||
});
|
||||
// This file is deprecated and no longer used.
|
||||
|
||||
Reference in New Issue
Block a user