X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins-dist%2Fstatistiques%2Fjavascript%2Fjquery.tflot.js;fp=www%2Fplugins-dist%2Fstatistiques%2Fjavascript%2Fjquery.tflot.js;h=8703a9c14ada420c01a35536e1fb1960b12e3ac8;hb=f489d45ae677afde12ba9c9f70f463ea34787b45;hp=d6307d96193756ac095e6687c857623e52184bdd;hpb=0dda6af18a04031b1ca8e217187966077e752fe3;p=ptitvelo%2Fweb%2Fwww.git diff --git a/www/plugins-dist/statistiques/javascript/jquery.tflot.js b/www/plugins-dist/statistiques/javascript/jquery.tflot.js index d6307d9..8703a9c 100644 --- a/www/plugins-dist/statistiques/javascript/jquery.tflot.js +++ b/www/plugins-dist/statistiques/javascript/jquery.tflot.js @@ -61,7 +61,8 @@ legend:{ show:true, container:null, - labelFormatter:null + labelFormatter:null, + noColumns: 3 }, bars: {fill:false}, yaxis: { min: 0 }, @@ -86,6 +87,7 @@ $.extend(true, values.options, options.flot); graph = $("
").appendTo(graphique); + graph.wrap("
"); gInfo = $("
").appendTo(graphique); // legende en dehors du dessin ? @@ -94,7 +96,7 @@ values.options.legend.container = legend; } // legende avec items clicables pour desactiver certaines series - if (options.legendeActions) { + if (options.legendeExterne && options.legendeActions) { values.options.legend.labelFormatter = function(label) { return '' + label + ''; } @@ -152,7 +154,7 @@ plots[idGraph] = $.plot(graph, values.series, values.options); // prevoir les actions sur les labels - if (options.legendeActions) { + if (options.legendeExterne && options.legendeActions) { $.extend(values.options, {legend:{container:null, show:false}}); actionsLegendes($('#graphique'+idGraph)); } @@ -351,11 +353,11 @@ $.extend(true, options, { lines:{ fill:true, - fillColor: { colors: [ { opacity: 0.7 }, { opacity: 0 } ] } + fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.9 } ] } }, bars:{ fill:true, - fillColor: { colors: [ { opacity: 0.7 }, { opacity: 0 } ] } + fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.9 } ] } } }); } @@ -426,16 +428,14 @@ // pour masquer / afficher certaines series // a ne charger qu'une fois par graph !!! $(graph).find('.legendLabel a').click(function(){ - tr = $(this).parent().parent(); - tr.toggleClass('cacher'); + tr = $(this).parent().prev('.legendColorBox').toggleClass('cacher').parent(); - // bof bof tous ces parent() et ca marche qu'avec legendeExterne:true - master = tr.parent().parent().parent().parent().parent(); + master = tr.closest('.graphique'); pid = master.attr('id').substr(9); // enlever 'graphique' var seriesActives = []; - tr.parent().find('tr:not(.cacher)').each(function(){ - nom = $(this).find('a').text(); + tr.find('.legendColorBox:not(.cacher)').each(function(){ + nom = $(this).next('.legendLabel').find('a').text(); n = collections[pid].values.series.length; for(i=0;i