[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-17 3:03:26
Message-ID: 20120217030326.74E8DA60B9 () git ! kde ! org
[Download RAW message or body]
Git commit 73a95576fd6ceb5d969178ab6da05fc7b537f387 by Shaun Reich.
Committed on 17/02/2012 at 03:42.
Pushed by sreich into branch 'plasma/sreich/qml2-system-monitors'.
looking better...the FilledLineGraph graph type/mode now has roughly
connected lines. it connects the present node to the next node, as it
traces along the pathways. Going to try a bezier curve on it, as now
they're just ugly straight lines
M +10 -3 plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
http://commits.kde.org/kde-workspace/73a95576fd6ceb5d969178ab6da05fc7b537f387
diff --git a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js \
b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js index \
c8f72f1..5f8b5c2 100644
--- a/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
+++ b/plasma/generic/applets/system-monitor/plotter/private/plotterpainter.js
@@ -168,6 +168,7 @@ function shiftLeft()
for (var j = 0; j < points[i].length; ++j) {
if (points[i][j].x < graphPadding || (points[i][j].x - horizSpace) < \
graphPadding) { + //FIXME: SHIFTS LEFT FAR, FAR TOO SOON, THE GRAPH \
CANT KEEP UP HARDLY // points[i].splice(j, 1);
}
@@ -357,9 +358,10 @@ function drawLines()
context.strokeStyle = "rgba(0, 255, 0, 0)"
- context.moveTo(graphPadding, height - graphPadding);
-
for (var i = 0; i < points.length; ++i) {
+
+ context.moveTo(graphPadding, height - graphPadding);
+
for (var j = 0; j < points[i].length; ++j) {
var x;
var y;
@@ -373,7 +375,12 @@ function drawLines()
context.fillStyle = points[i][j].fillColor;
context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x + 5, y);
- context.lineTo(points[i][j].x + graphPadding, height - graphPadding);
+ if (j < points[i].length - 1) {
+ context.lineTo(points[i][j + 1].x, points[i][j + 1].scaledY);
+ } else {
+ context.lineTo(points[i][j].x, height - graphPadding);
+ }
+// context.lineTo(points[i][j].x + graphPadding, height - graphPadding);
}
context.lineTo(graphPadding, height - graphPadding);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic