[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-workspace/plasma/sreich/qml2-system-monitors] plasma/generic/applets/system-monitor/plotter/pri
From: Shaun Reich <shaun.reich () kdemail ! net>
Date: 2012-02-16 22:54:42
Message-ID: 20120216225442.97864A60C6 () git ! kde ! org
[Download RAW message or body]
Git commit 1c9db03b6461fbdf0d6e2868ee322db0c75bc484 by Shaun Reich.
Committed on 16/02/2012 at 21:41.
Pushed by sreich into branch 'plasma/sreich/qml2-system-monitors'.
technically it should *attempt* to be drawing 2 graphs now
looks like it half works. going to add colors first
M +12 -4 plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
http://commits.kde.org/kde-workspace/1c9db03b6461fbdf0d6e2868ee322db0c75bc484
diff --git a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js \
b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js index \
b0dae51..d04c211 100644
--- a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
+++ b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
@@ -71,6 +71,7 @@ function addSample(y, sampleSet)
points.push(new Array());
print("PUSHED NEW ARRAY TO POINTS");
points[points.length - 1].push(new Array());
+// points[points.length - 1][points
}
print("INITILA LENGTH: " + points.length);
@@ -78,9 +79,13 @@ function addSample(y, sampleSet)
// set x at a predefined interval (horizSpace)
// only takes into consideration current length of sampleSet
// because that's all that matters (each set is compartmentalized)
- var xValue = graphPadding + (horizSpace * (points[points.length - 1][0].length) \
);
- print("X VALUE: " + xValue);
+ var pointsIndex = points.length - 1;
+ var xValue = graphPadding + (horizSpace * (points[pointsIndex].length));
+ print("POINTS[INDEX][0] " + points[pointsIndex].length)
+print("X VALUE: " + xValue);
+
+// print("X VALUE: " + points[points.length - 1][points[points.length - 1].length \
- 1].x); var yValue = y;
// print(points[points.length - 1][points.length].originalY);
@@ -89,7 +94,7 @@ function addSample(y, sampleSet)
print("NEWLENGTH: " + points.length);
- points[points.length - 1][points[points.length - 1].length - 1] = { x: \
xValue, originalY: yValue, scaledY: yValue }; + points[points.length - \
1].push( { x: xValue, originalY: yValue, scaledY: yValue } ); debug("SAMPLE POINT \
ADDED:" + points[points.length - 1][points[points.length - 1].length - 1].x ); // \
print("SAMPLE LISTS POINTS:length: " + sampleSetLength + " " + points[points.length \
- 1][sampleSetLength - 1].x);
@@ -302,9 +307,12 @@ function drawBarGraph()
context.moveTo(graphPadding, height - graphPadding);
for(var i = 0; i < points.length; ++i) {
- for(var j = 0; j < points[i][j].length; ++j) {
+ for(var j = 0; j < points[i].length; ++j) {
var x;
var y;
+ print("$$$$$$$$$$$$ DRAWING BARS AT X: " + x)
+ print("$$$$$$$$$$$$ DRAWING BARS AT Y: " + y)
+
x = points[i][j].x;
y = points[i][j].scaledY;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic