Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/stats_viewer.js
diff options
context:
space:
mode:
authorSebastian Silva <sebastian@somosazucar.org>2013-06-13 08:03:37 (GMT)
committer Sebastian Silva <sebastian@somosazucar.org>2013-06-13 08:03:37 (GMT)
commit5460fa030163e2d6bc4a9d38d8b360e8611e7ac9 (patch)
treec6043484aaea57d4ebbfbe27452cc39006d824a1 /stats_viewer.js
parentb30a87a953f4a589a4fc0b36aaa00a3d9b341210 (diff)
Fix axis labels and added zoom functionality. Set start date to first data.HEADmaster
Diffstat (limited to 'stats_viewer.js')
-rw-r--r--stats_viewer.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/stats_viewer.js b/stats_viewer.js
index 77b2b4a..15fc8e3 100644
--- a/stats_viewer.js
+++ b/stats_viewer.js
@@ -10,7 +10,7 @@ function update_view() {
$("body").css("cursor", "progress");
$.ajax({
- url: "http://localhost:10001/",
+ url: "http://node.sugarlabs.org/",
data: {
cmd: "stats",
start: time1,
@@ -21,12 +21,32 @@ function update_view() {
success: function( data ) {
$("body").css("cursor", "default");
fixed_data = data[stat_obj].reduce( function(a,b,c) {
- a.push([c,b[1][stat_type]]);
+ a.push( [new Date ( b[0] * 1000 ) , b[1][stat_type]]);
return a
}, []
);
$('#chartdiv').empty();
- $.jqplot('chartdiv', [fixed_data]);
+ $.jqplot('chartdiv', [fixed_data], {
+ title:stat,
+ axes: {
+ xaxis: {
+ renderer: $.jqplot.DateAxisRenderer,
+ min:new Date( time1 * 1000),
+ max:new Date( time2 * 1000),
+ tickInterval: '1 month',
+ tickOptions:{formatString:'%Y/%m/%d'}
+ },
+ yaxis: {
+ min:0
+ }
+ },
+ cursor:{
+ show: true,
+ zoom:true,
+ showTooltip:false
+ }
+ }
+ );
},
error: function() {
$("body").css("cursor", "default");