From 89314bd22e7d3c50afc663872e24293005d486f0 Mon Sep 17 00:00:00 2001
From: "booz@rezo.net" <>
Date: Wed, 31 Oct 2018 11:48:55 +0000
Subject: [PATCH] Affichage des stats plus lisible quand on passe > 100 000 et
formatage avec espace des milliers
---
.../squelettes/inclure/stats-visites-jours.html | 16 ++++++++--------
prive/stats/visites.html | 17 ++++++++++++++++-
prive/style_prive_plugin_stats.html | 2 +-
3 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/prive/squelettes/inclure/stats-visites-jours.html b/prive/squelettes/inclure/stats-visites-jours.html
index 7433228..6e7fe21 100644
--- a/prive/squelettes/inclure/stats-visites-jours.html
+++ b/prive/squelettes/inclure/stats-visites-jours.html
@@ -24,30 +24,30 @@
<:info_maximum|trim{':'}|trim|ucfirst:> |
- #GET{max} |
+ [(#GET{max}|number_format{0,""," "})] |
<:info_moyenne|trim{':'}|trim|ucfirst:> |
- [(#GET{moy}|round)] |
+ [(#GET{moy}|round|number_format{0,""," "})] |
<:info_aujourdhui|trim{':'}|trim|ucfirst:> |
- #GET{last} |
+ [(#GET{last}|number_format{0,""," "})] |
<:info_hier|trim{':'}|trim|ucfirst:> |
- #GET{lastlast} |
+ [(#GET{lastlast}|number_format{0,""," "})] |
<:statistiques:info_popularite_5|trim{':'}|trim|ucfirst:> |
- [(#CHAMP_SQL{popularite}|round)] |
+ [(#CHAMP_SQL{popularite}|round|number_format{0,""," "})] |
<:info_total|trim{':'}|trim|ucfirst:> |
- [(#VISITES|round)] |
+ [(#VISITES|round|number_format{0,""," "})] |
|
@@ -56,11 +56,11 @@
<:info_total|trim{':'}|trim|ucfirst:> |
- [(#REM|stats_total)] |
+ [(#REM|stats_total|number_format{0,""," "})] |
<:statistiques:info_popularite_2|trim{':'}|trim|ucfirst:> |
- [(#CONFIG{popularite_total}|round)] |
+ [(#CONFIG{popularite_total}|round|number_format{0,""," "})] |
/B_art>
diff --git a/prive/stats/visites.html b/prive/stats/visites.html
index 59655b3..769f930 100644
--- a/prive/stats/visites.html
+++ b/prive/stats/visites.html
@@ -70,7 +70,22 @@ function trace_stats_table(table, classes, options) {
]
},
yaxis:{
- position: "right"
+ position: "right",
+ tickDecimals: 1,
+ tickFormatter: function nbFormatter(val, axis) {
+ if (val >= 1000000){
+ var fval = (val / 1000000).toFixed(axis.tickDecimals) ;
+ return fval.replace(/\.0$/,"") + " M";
+ }
+ else{
+ if (val >= 100000)
+ return (val / 1000).toFixed(axis.tickDecimals).replace(/\.0$/,"") + " k";
+ else{
+ var fval = val.toFixed(axis.tickDecimals).replace(/\.0$/,"") ;
+ return fval.replace(/(\d{3})$/," $1") ;
+ }
+ }
+ }
}
},
infobulle:{show:true}
diff --git a/prive/style_prive_plugin_stats.html b/prive/style_prive_plugin_stats.html
index 028f396..23f04ad 100644
--- a/prive/style_prive_plugin_stats.html
+++ b/prive/style_prive_plugin_stats.html
@@ -49,7 +49,7 @@ table#visites tr.c_recap th {background-color:#[(#GET{foncee}|couleur_foncer)];c
/* graphique flot */
.graphique{clear:both; overflow:hidden; margin-bottom:2em;}
-.graphResult-wrap {padding: 10px 25px;float:#GET{left};}
+.graphResult-wrap {padding: 10px;float:#GET{left};}
.graphResult{}
.graphInfo{float:#GET{left}; clear:#GET{left};margin-#GET{left}:20px;}
.graphInfo td {padding: 5px;}