diff --git a/views/bootstrap/class.Charts.php b/views/bootstrap/class.Charts.php index 6bdbb5e21..d3ab00ee6 100644 --- a/views/bootstrap/class.Charts.php +++ b/views/bootstrap/class.Charts.php @@ -46,6 +46,7 @@ class SeedDMS_View_Charts extends SeedDMS_Bootstrap_Style { $this->htmlAddHeader( ''."\n". ''."\n". + ''."\n". ''."\n"); $this->htmlStartPage(getMLText("folders_and_documents_statistic")); @@ -85,7 +86,48 @@ echo "
\n"; }).appendTo("body"); + var data = [ +$rec) { + $key = mktime(12, 0, 0, substr($rec['key'], 5, 2), 1, substr($rec['key'], 0, 4)) * 1000; + echo '["'.$rec['key'].'",'.$rec['total'].'],'."\n"; +// echo '['.$i.','.$rec['total'].'],'."\n"; + } +?> + ]; + $.plot("#chart", [data], { + xaxis: { + mode: "categories", + tickLength: 0, + }, + series: { + bars: { + show: true, + align: "center", + barWidth: 0.8, + }, + }, + grid: { + hoverable: true, + clickable: true + }, + }); + + $("#chart").bind("plothover", function (event, pos, item) { + if(item) { + var x = item.datapoint[0];//.toFixed(2), + y = item.datapoint[1];//.toFixed(2); + $("#tooltip").html(item.series.xaxis.ticks[x].label + ": " + y) + .css({top: pos.pageY-35, left: pos.pageX+5}) + .fadeIn(200); + } else { + $("#tooltip").hide(); + } + }); + var data = [ var data = [ ]; $.plot('#chart', data, {