You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ec...@apache.org on 2008/04/23 11:22:41 UTC

svn commit: r650802 - /geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java

Author: ecraig
Date: Wed Apr 23 02:22:38 2008
New Revision: 650802

URL: http://svn.apache.org/viewvc?rev=650802&view=rev
Log:
GERONIMO-3972
 Monitering Graphics failed to represent in IE 6 SP2


Modified:
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java?rev=650802&r1=650801&r2=650802&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java (original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java Wed Apr 23 02:22:38 2008
@@ -77,8 +77,11 @@
         GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
         for (int i = 1; i < dataSet1.size(); i++) {
             Date date = new Date((Long) snapshotTimes.get(i));
-            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
-                    + "' }, \n";
+            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date);
+            if ((i+1) != dataSet1.size())
+                GraphJS += "' }, \n";
+            else
+            	GraphJS += "' } \n";
         }
         GraphJS += "]});\n";
         GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
@@ -94,7 +97,8 @@
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i)
                         - (Long) dataSet2.get(i - 1));
-                GraphJS += ",";
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",";
             }
         }
         if (data1operation == 'D' && data2operation != 'D') {
@@ -103,7 +107,8 @@
                         + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1));
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i));
-                GraphJS += ",";
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",";
             }
         }
         if (data1operation != 'D' && data2operation == 'D') {
@@ -112,7 +117,8 @@
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i)
                         - (Long) dataSet2.get(i - 1));
-                GraphJS += ",";
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",";
             }
         }
         if (data1operation != 'D' && data2operation != 'D') {
@@ -120,7 +126,8 @@
                 GraphJS = GraphJS + dataSet1.get(i);
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i));
-                GraphJS += ",";
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",";
             }
         }
 
@@ -172,8 +179,11 @@
         GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
         for (int i = 1; i < dataSet1.size(); i++) {
             Date date = new Date((Long) snapshotTimes.get(i));
-            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
-                    + "' }, \n";
+            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date);
+            if ((i+1) != dataSet1.size())
+                GraphJS += "' }, \n";
+            else
+            	GraphJS += "' } \n";
         }
         GraphJS += "]});\n";
         GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
@@ -183,12 +193,15 @@
         if (data1operation == 'D')
             for (int i = 1; i < dataSet1.size(); i++) {
                 GraphJS = GraphJS
-                        + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1))
-                        + operation + ",\n";
+                        + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) + operation;
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",\n";
             }
         if (data1operation != 'D')
             for (int i = 1; i < dataSet1.size(); i++) {
-                GraphJS = GraphJS + dataSet1.get(i) + operation + ",\n";
+                GraphJS = GraphJS + dataSet1.get(i) + operation;
+                if ((i+1) != dataSet1.size())
+                    GraphJS += ",\n";
             }
 
         GraphJS = GraphJS + "]);\n";