brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.31k stars 620 forks source link

Made downspeedgraph and upspeedgraph use same scaling #1990

Closed donutAnees closed 4 months ago

donutAnees commented 4 months ago

Checklist

Description

Before

In the current latest code of conky, downspeedgraph and upspeedgraph look the same because they're both individually scaled with respect to max value.

Screenshot 2024-07-20 at 10 59 35 PM

After

Screenshot 2024-07-21 at 3 15 48 AM Screenshot 2024-07-21 at 3 15 59 AM

This has now been fixed and both of them are scaled on a common axis. I have tested the code, and it does not influence any other graphs.

The changes made include

  1. Adding char speedgraph flag to the struct graph and struct special_node.
  2. Declaring a global double maxval to keep track of the current max value across the two graphs.
  3. Adding parameter char speedgraph to scan_graph method.
  4. And finally checking if the current value getting added is bigger than maxval, if so we make our scale = maxval, in the graph_append method.
netlify[bot] commented 4 months ago

Deploy Preview for conkyweb canceled.

Name Link
Latest commit 0419eb07368cbf0a298b9b72eb6affc57c68baf4
Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/669c34ebe431dc000897f718