chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r1033666 - in /incubator/chukwa/trunk: CHANGES.txt src/web/hicc/js/flot.extend.js
Date Wed, 10 Nov 2010 19:37:34 GMT
Author: asrabkin
Date: Wed Nov 10 19:37:33 2010
New Revision: 1033666

URL: http://svn.apache.org/viewvc?rev=1033666&view=rev
Log:
CHUKWA-544. HICC graph should handle single series or multiple series more gracefully. Contributed
by Eric Yang.

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/src/web/hicc/js/flot.extend.js

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1033666&r1=1033665&r2=1033666&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Wed Nov 10 19:37:33 2010
@@ -54,6 +54,8 @@ Trunk (unreleased changes)
 
   BUG FIXES
 
+    CHUKWA-544. HICC graph should handle single series or multiple series more gracefully.
(Eric Yang via asrabkin)
+
     CHUKWA-447. Correct time units in ExecAdaptor. (Eric Yang via asrabkin)
 
     CHUKWA-542.  Disable hbase jar download from maven, and include hicc rest api in HICC
web.xml (Eric Yang)

Modified: incubator/chukwa/trunk/src/web/hicc/js/flot.extend.js
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/web/hicc/js/flot.extend.js?rev=1033666&r1=1033665&r2=1033666&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/web/hicc/js/flot.extend.js (original)
+++ incubator/chukwa/trunk/src/web/hicc/js/flot.extend.js Wed Nov 10 19:37:33 2010
@@ -272,12 +272,21 @@ function refresh(url, parameters) {
  * Initialize data from REST API.
  */
 function loadData() {
+  _chartSeriesSize=0;
   for(var i=0;i<_series.length;i++) {
     $.getJSON(_rest[i], function(json) {
-      var name=json.name;
-      _series[_chartSeriesSize].label=name
-      _series[_chartSeriesSize].data=json.data;
-      _chartSeriesSize++;
+      if(json.constructor.toString().indexOf("Array") != -1) {
+        for(var index=0;index<json.length;index++) {
+          _series[_chartSeriesSize].label=json[index].name;
+          _series[_chartSeriesSize].data=json[index].data;
+          _chartSeriesSize++;
+        }
+      } else {
+        var name=json.name;
+        _series[_chartSeriesSize].label=name;
+        _series[_chartSeriesSize].data=json.data;
+        _chartSeriesSize++;
+      }
       wholePeriod();
     }); 
   }



Mime
View raw message