Skip to content
Extraits de code Groupes Projets
Valider 8d27a133 rédigé par marcimat's avatar marcimat
Parcourir les fichiers

feat: utiliser les stats d3 aussi sur les stats globales du site

parent db142928
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,100 +4,6 @@
<h2 class='objet_titre'><a href='#URL_TRADLANG_MODULE'>#NOM_MOD</a></h2>
</BOUCLE_expose>
<INCLURE{fond=inclure/stats-trads-jours,ajax,env} />
<INCLURE{fond=inclure/stats-trads-mois,ajax,env} />
<INCLURE{fond=css/vars_spip.css} />
<INCLURE{fond=prive/stats/visites} />
<script type="text/javascript">
function trace_trads_table(table, classes, options) {
$table = $(table);
if ($table.is(':hidden')) {
return true; // pas a faire ou deja fait.
}
// copier le titre des tableaux
titre = $table.find("caption").text();
$table
.before("<h2>" + titre + "</h2>")
.wrap("<div class='" + classes + "'></div>");
// mettre les visites avec un fond colore pour le graphique
$table.find("thead th:eq(1)").data({fill: true, serie: 'bar', color: '#FFD845'});
$table.find("thead th:eq(2)").data({serie: 'line', color: '#7FC4FF'});
params = {
legendeExterne:true,
legendeActions:true,
width:$table.parent().width()+'px',
height:'250px',
modeDate:true,
zoom:true,
parse:{
axeOnTitle:true,
defaultSerie:{
bars:{show:true},
lines:{show:true},
points:{show:false}
}
},
flot:{
xaxis:{
labelWidth:45,
monthNames: [
'[(#VAL{2000-01-01}|nom_mois)]',
'[(#VAL{2000-02-01}|nom_mois)]',
'[(#VAL{2000-03-01}|nom_mois)]',
'[(#VAL{2000-04-01}|nom_mois)]',
'[(#VAL{2000-05-01}|nom_mois)]',
'[(#VAL{2000-06-01}|nom_mois)]',
'[(#VAL{2000-07-01}|nom_mois)]',
'[(#VAL{2000-08-01}|nom_mois)]',
'[(#VAL{2000-09-01}|nom_mois)]',
'[(#VAL{2000-10-01}|nom_mois)]',
'[(#VAL{2000-11-01}|nom_mois)]',
'[(#VAL{2000-12-01}|nom_mois)]'
]
}
},
infobulle:{show:true}
}
$table.tFlot($.extend(true, {}, params, options));
}
function trace_trads(){
trace_trads_table(
"#trads_quotidiennes",
"statistiques_trads_quotidiennes statistiques_trads",
{
grille:{weekend:true},
flot:{
xaxis:{
minTickSize: [1, "day"]
},
bars:{barWidth:24 * 60 * 60 * 1000}
}
});
trace_trads_table(
"#trads_mensuelles",
"statistiques_trads_mensuelles statistiques_trads", {
grille:{years:true},
flot:{
xaxis:{
timeformat:"%b %y",
minTickSize: [1, "month"]
},
bars:{barWidth:30 * 24 * 60 * 60 * 1000 /* nb de jours... approximatif */}
}
});
}
(function($){
$(document).ready(function(){
trace_trads();
onAjaxLoad(trace_trads);
});
})(jQuery);
</script>
<INCLURE{fond=inclure/stats-trads-data, id_auteur=#NULL, ajax, env} />
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter