瀏覽代碼

HUE-527. Small changes for HueChart.Area, Box, and js to repair Area functionality.

Marcus McLaughlin 14 年之前
父節點
當前提交
37997e27dd

+ 2 - 2
desktop/core/static/js/Source/Hue/HueChart.Area.js

@@ -60,11 +60,11 @@ HueChart.Area = new Class({
 						seriesPeaks.push(newPeak);
 				}
 				//Return series and value if the center of the range is greater than the sum of previous values, but less than that sum plus the next value.
-				var toReturn = null;
+				var toReturn = [];
 				for (i = 0; i < this.series.length; i++) {
 						lastPeak = seriesPeaks[i - 1] || 0;
 						if (seriesPeaks[i] > yCenter && yCenter > lastPeak) {
-								toReturn = {'name' : this.series[i], 'value': dataPoint[this.series[i]] };
+								toReturn.push({'name' : this.series[i], 'value': dataPoint[this.series[i]] });
 						}
 				}
 				return toReturn;

+ 3 - 3
desktop/core/static/js/Source/Hue/HueChart.Box.js

@@ -132,10 +132,10 @@ HueChart.Box = new Class({
 							if (this.options.ticks.x || this.options.ticks.y) this.setTicks(vis);
 							//Add axis labels if enabled
 							if (this.options.showLabels) this.setLabels(vis);
-							//Add position indicator if enabled
-							if (this.options.positionIndicator) this.setPositionIndicators(vis);
 							//Add representation of the data.
 							this.addGraph(vis);
+							//Add position indicator if enabled
+							if (this.options.positionIndicator) this.setPositionIndicators(vis);
 							//Create panel for capture of events
 							this.eventPanel = vis.add(pv.Panel).fillStyle("rgba(0,0,0,.001)");
 							//If there's a mouse event, add the functionality to capture these events.
@@ -610,7 +610,7 @@ HueChart.Box = new Class({
 					return seriesObject.value.toInt().convertFileSize();
 				}
 			}
-			return String(value.round(2)) + " " + units;
+			return value.toInt().round(2) + " " + units;
 		},
 		//Updates the display of the currently visible tip
 		updatePointValue: function(seriesList) {

+ 1 - 1
desktop/core/static/js/Source/Hue/HueChart.js

@@ -92,7 +92,7 @@ HueChart = new Class({
 				this.options.leftPadding = $pick(this.options.leftPadding, this.options.padding[3], this.options.padding[1], this.options.padding[0]);
 				var table = document.id(this.options.dataTable);
 				if (table) {
-						this.data = new HueChart.Data(HueChart.buildData(table));
+						this.data = new HueChart.Data(HueChart.buildDataFromTable(table));
 						table.hide();
 				} else {
 						this.data = new HueChart.Data(this.options.dataObject);