Kip icon indicating copy to clipboard operation
Kip copied to clipboard

feat: logarithmic scaling for radial gauge

Open x7y8z9 opened this issue 1 year ago • 1 comments

Radial gauge current I created a radial gauge for summarized charge/discharge current of two 24V battery banks. I'm interested in the details (amp by amp) up to 15-20A. Between 120 and 150A, it doesn't matter to view 2 or 3A. I would actually have to extend the display scale to 200A, but unfortunately the display range at the lower end would then disappear completely. The solution would be logarithmic scaling.

x7y8z9 avatar Apr 01 '24 15:04 x7y8z9

I've done some research and tried a few approaches but I've not found out how. Logarithmic scale are exponential and so it's not what we you need. It will do the opposite where the large number are the focus ie. with a scale of from 0, 1 ,10 ,100 , 1000 Amps, all evenly spaced. So it make it worst. I've looked at square root, and a cushion approach where I do the math to create a non linear progression on a linear scale but the gauge library does not support all I need. It's either that the needle does not move according to the scale or the ticks are off.

We need to "zoom" on an area of focus on the scale. which makes it non-linear. If I normalize the data it works, but the ticks won't.

I've not found a mathematical way... yet. If you have an idea, point me to the material and I'll try. Maybe easier with charts.

godind avatar Apr 28 '24 02:04 godind