It is currently May 3rd, 2024, 3:37 am

autoscaling question

Get help with installing and using Rainmeter.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

autoscaling question

Post by UnforgivenRevival »

Is there a way to make lines and histograms that autoscale scale to the highest point read? Right now it seems the autoscale has pre defined ranges. For example, The predefined ranges go 1-2-5-10-20-50-100 or something like that. When something reads for example 51, It autoscales to 100, Leaving a big space between the highest point and the height of the line meter. It would be cool to see the biggest point be right at the max line height, instead of having a gap between the highest line point and the height of the line meter. I was just wondering if this is possible or not.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: autoscaling question

Post by MerlinTheRed »

I don't know if it's possible with a simple command, but I think you can do it with a little workaround.

You need one calc measure that constantly checks for a new maximum value and one calc measure that pipes the original neasure's value and adjusts its maxValue to the current maximum. It seems the NetIn's MaxValue does not work and adjusting NetInSpeed does not work either. Piping through a calc was the only Way I could get it to work:

Code: Select all

[Rainmeter]
BackgroundMode=2
SolidColor=ffffff80
Update=1000
MiddleMouseDownAction=[!Refresh]

[Variables]
CurrentMaxTraffic=1

[MeasureNetIn]
Measure=NetIn

;use a calc measure with alternating values to check for a new maximum each update cycle
[MeasureCheckMax]
Measure=Calc
Formula=(MeasureCheckMax+1)%2
IfAboveValue=0
IfAboveAction=!SetVariable "CurrentMaxTraffic" "([MeasureNetIn] > #CurrentMaxTraffic# ? [MeasureNetIn] : #CurrentMaxTraffic#)"
IfBelowValue=1
IfBelowAction=!SetVariable "CurrentMaxTraffic" "([MeasureNetIn] > #CurrentMaxTraffic# ? [MeasureNetIn] : #CurrentMaxTraffic#)"
DynamicVariables=1

;use a calc measure as a pipe, adjusting its max value to the current maximum traffic
[MeasureScale]
Measure=Calc
Formula=MeasureNetIn
MinValue=0
MaxValue=#CurrentMaxTraffic#
DynamicVariables=1

[MeterHistogram]
Meter=Histogram
MeasureName=MeasureScale
X=0
Y=0
W=300
H=50
DynamicVariables=1
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: autoscaling question

Post by UnforgivenRevival »

Sorry for a delay in response, Ill have to try this out. Thanks for helping so far.