diff --git a/resources/js/stats-dashboard.js b/resources/js/stats-dashboard.js index 710b95f..2c5c87e 100644 --- a/resources/js/stats-dashboard.js +++ b/resources/js/stats-dashboard.js @@ -14,20 +14,14 @@ function buildLevelDataCharts(level) { }); } const colorPalettes = [ - ['#1d4ed8', '#3b82f6', '#60a5fa', '#93c5fd', '#c3dafe'], - ['#1d4ed8', '#3c67dc', '#5b81e0', '#7a9be3', '#99b5e7'], - ['#1223C2', '#030E8E', '#3D49C7', '#6D77D0'], - ['#1d4ed8', '#3b82f6', '#60a5fa', '#93c5fd', '#c3dafe'], - ['#1240a1', '#2e6ee0', '#548bf7', '#81aefd', '#a9d2ff'], - ['#0a37a8', '#2d65d4', '#5794ff', '#7dbdff', '#a3dcff'], - ['#1a3d9c', '#4271d9', '#75a7ff', '#9fc5ff', '#c6e2ff'], - ['#084ba6', '#3a79d6', '#6ba5ff', '#96c3ff', '#badbff'], - ['#1137a3', '#3267d6', '#5fa3ff', '#8fc1ff', '#b5e0ff'], + '#1240a1', + '#2e6ee0', + '#548bf7', + '#81aefd', + '#a9d2ff', ]; - - // console.log('score', scoreDistributionDataset); new Chart( - document.getElementById('graphic-score-repartition'), + level.querySelector('.graphic-score-repartition'), { type: 'pie', data: { @@ -36,7 +30,7 @@ function buildLevelDataCharts(level) { ), datasets: [ { - backgroundColor: colorPalettes[4], + backgroundColor: colorPalettes, label: 'Nombres de joueurs', data: scoreDistributionDataset.map( (row) => row.count @@ -93,15 +87,11 @@ function buildRatingsDataChart() { }); } const colorPalettes = [ - ['#1d4ed8', '#3b82f6', '#60a5fa', '#93c5fd', '#c3dafe'], - ['#1d4ed8', '#3c67dc', '#5b81e0', '#7a9be3', '#99b5e7'], - ['#1223C2', '#030E8E', '#3D49C7', '#6D77D0'], - ['#1d4ed8', '#3b82f6', '#60a5fa', '#93c5fd', '#c3dafe'], - ['#1240a1', '#2e6ee0', '#548bf7', '#81aefd', '#a9d2ff'], - ['#0a37a8', '#2d65d4', '#5794ff', '#7dbdff', '#a3dcff'], - ['#1a3d9c', '#4271d9', '#75a7ff', '#9fc5ff', '#c6e2ff'], - ['#084ba6', '#3a79d6', '#6ba5ff', '#96c3ff', '#badbff'], - ['#1137a3', '#3267d6', '#5fa3ff', '#8fc1ff', '#b5e0ff'], + '#1240a1', + '#2e6ee0', + '#548bf7', + '#81aefd', + '#a9d2ff', ]; // console.log('score', scoreDistributionDataset); @@ -115,7 +105,7 @@ function buildRatingsDataChart() { ), datasets: [ { - backgroundColor: colorPalettes[4], + backgroundColor: colorPalettes, label: 'Nombres de joueurs', data: ratingDistributionDataset.map( (row) => row.count diff --git a/template-parts/statistics/dashboard.php b/template-parts/statistics/dashboard.php index d150d78..2d43630 100644 --- a/template-parts/statistics/dashboard.php +++ b/template-parts/statistics/dashboard.php @@ -75,7 +75,7 @@ $level_post_ids = $wpdb->get_col("