canvas-gauges icon indicating copy to clipboard operation
canvas-gauges copied to clipboard

Gauges as plugin in freeboard

Open SteMMo33 opened this issue 3 years ago • 1 comments

Hello all, Im trying to insert the gauge as plugin in a freeboard project. Almost everything is ok ( title, fonts, units, highlights, ..): the only items not controlled are the ticks - they are always 0-100 even if I change minValue and/or maxValue. The highlights and needle are correctly aligned with the range, the ticks are misaligned and always in the range 0-100.

I tested radial and linear gauges and both of them show the problem. Thanks!

SteMMo33 avatar Aug 24 '21 15:08 SteMMo33

Hello, maybe I find the problem: The case is when the options.majorTicks is not provided (then its values are [0,,,100] - maybe the default range) and options.exactTicks = false.

file: LinearGauges.js Function drawLinearMajorTicksNumbers correctly generates in tickValues map (row 809) the set of ticks aligned with the current range (rows 810-812) When the funtion starts the loop to print in the canvas the ticks values, now it gets tick value from majorTicks set (row 832): tick = options.majorTicks[i]; In my case it is always printed the 0..100 set of ticks: in my undestanding tick variable have to get from ticks variable e.g.: tick = ticks[i];

I changed my local source and it works!

Regards

SteMMo33 avatar Aug 25 '21 09:08 SteMMo33