Created attachment 137274 [details]
Screenshot of systemmonitor history tab
Its especially noticeable on the end of the Memory graph, see the attached screenshot.
This is on the Wayland session, Qt 5.15.2.
Can confirm the weird lumps on X11 too.
Afaik that's an artifact of the line smoothing algorithm
Yes it is. The same happens in for example libreoffice calc when using a smoothed line chart with the values [0, 0, 1000, 1000, 1000] or Google Charts: https://jsfiddle.net/dswy5vmh/ . Generally smoothing algorithms are a case of choosing which tradeoffs to accept, I decided that it'd be better to follow what other charts do rather than doing something special.
Is there any way to tweak the smoothing algorithm so we still get nicely smoothed graphs, without the tiny lumps?
*** Bug 437309 has been marked as a duplicate of this bug. ***
There is an algorithm called "Monotone cubic interpolation" that looks encouraging.
I hate asking trivial questions, but did you have a look at ksysguards's implementation? because graphs were fine there.
Also, I don't know well enough the actual implementation of systemmonitor's graphs, but does it make sense to polynomially interpolate a non-functional data set in the first place? It's not like, say, sin(x) what we're trying to draw. Points are function of time, but of no known/meaningful model.
We're not interested in reconstructing the function behind some points in a data set, we only want to draw a smooth graph. This looks to my innocent eyes more like a linear interpolation of the data set, plus some graphical smoothing of the resulting curve afterwards.
FWIW ksysguard's older implementation is not relevant because it uses an older custom graph rather than the fancy new GPU-accelerated graphing framework we use for lots of things. Unifying on a single implementation that can take advantage of hardware acceleration on modern computers to use fewer CPU resources.
One advantage of the new system is that once this bug is fixed in one place, it will be fixed for all clients that use it (e.g. System Monitor app, System Monitor widgets, Network applet's speed graph, and so on.)
(In reply to Nate Graham from comment #8)
> FWIW ksysguard's older implementation is not relevant because it uses an
> older custom graph rather than the fancy new GPU-accelerated graphing
> framework we use for lots of things. Unifying on a single implementation
> that can take advantage of hardware acceleration on modern computers to use
> fewer CPU resources.
> One advantage of the new system is that once this bug is fixed in one place,
> it will be fixed for all clients that use it (e.g. System Monitor app,
> System Monitor widgets, Network applet's speed graph, and so on.)
ah right, understand
Git commit c91c837fbab2e966165c47f4fbbe96e16eb3f073 by Arjen Hiemstra.
Committed on 03/06/2021 at 11:42.
Pushed by ahiemstra into branch 'master'.
Implement monotonic cubic interpolation for line charts
Replace the existing cubic interpolation in the line chart with cubic
monotonic interpolation, which tries harder to preserve monotonicity and
that way avoids over or under shooting the target point. As a bonus, the
implementation turns out simpler than the cubic implementation we
currently have, which should improve performance.
M +114 -92 src/LineChart.cpp