LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wide Meter Wanted

Solved!
Go to solution

I want a wide graphical numeric indicator with a color ramp.  Something like this:

paul_cardinale_0-1648244306701.png

Meters have color ramps, but their aspect ratio is not changeable.

A slider can have any aspect ratio, but it can't have a color ramp.

Has anyone already built a custom control that's like a slider but with a color ramp?

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 17
(2,868 Views)

What do you mean by meters' "aspect ratio is not changeable"? I can change the width and height of the color part of a meter in a way that seems similar (to me, anyway) to how I can resize a slider.

 

meter.png

 

(I'm not a graphics guy, so bear with me if there is nuance to your question I'm not getting)

0 Kudos
Message 2 of 17
(2,817 Views)

I guess perhaps that the meter doesn't allow individually changing the width or height?

This means (as far as I can see, also not a "graphics guy") that you're constrained to having a ramp that is circular (rather than e.g. ellipsoidal). (Actually, maybe only the NXG style is circular, and the others are ellipsoidal, but in that case I'd adjust my comment to suggest that you can't adjust the ratio between the major and minor axes.)

 

It also looks like maybe the Meters can't adjust their min/max angles - for the NXG style I get ~180degrees, and for the others I see what you showed, maybe a bit less than 90 degrees?


GCentral
0 Kudos
Message 3 of 17
(2,797 Views)

He likely means the fact that the housing size of the meter only can be changed in the same way as other elements when you press the shift button, and that not even fully, with shift button pressed you can expand an object in horzontal or vertical way only and in a way that maintains the width/height aspect ratio. This last one can be very handy when trying to resize a round LED to avoid turning it into an ellipsoid.

meter aspect ratio.png

It's actually even more sneaky. In customize mode you can resize the backrground in any way you want but the meter area is the one that limits the resizing to maintain the aspect ratio.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 17
(2,777 Views)

@Darren wrote:

What do you mean by meters' "aspect ratio is not changeable"? I can change the width and height of the color part of a meter in a way that seems similar (to me, anyway) to how I can resize a slider.

 

meter.png

 

(I'm not a graphics guy, so bear with me if there is nuance to your question I'm not getting)


When I say that the "aspect ratio is not changeable" what I really mean is that the aspect ratio is not changeable.  I.e. when I change the size, both the height and width change simultaneously, and the ratio of height to width (the aspect ratio) remains the same.

I want to make a meter that is wider, but not higher.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 17
(2,755 Views)

I suppose the logic is that these meters resemble physical meters, and as the needle makes a circle, the meter has to stay to ratio...

 

You can replace a slider's background with a gradient decoration (2 colors only):

 

wiebeCARYA_1-1648554508623.png

 

Or a custom PNG (pixelated)...

 

Otherwise I guess you'll have to use a picture control and\or an XControl...

Message 6 of 17
(2,699 Views)

wiebe@CARYA wrote:

I suppose the logic is that these meters resemble physical meters, and as the needle makes a circle, the meter has to stay to ratio...

 

You can replace a slider's background with a gradient decoration (2 colors only):

 

wiebeCARYA_1-1648554508623.png

 

Or a custom PNG (pixelated)...

 

Otherwise I guess you'll have to use a picture control and\or an XControl...


Can't just put an image on the background because I need the ramp data to be updated from a DB.

My guess is that the reason for the limitation is that the pointer is made by having a line segment pivot at a point; which means that its tip always follows a circular arc.  If the scale were stretched into an elliptical arc, the tip of the pointer wouldn't stay on the scale.  It would be possible to scale it in such a manner that the arc is always circular (by changing the angle covered); but they probably didn't want to spend the effort on something that most people won't care about.

I ended up making an XControl.  Since I only need 3 colors (under range, in range, over range), I used a horizontal slider with 3 pointers: One for the indicator, and 2 invisible ones with fill colors for over/under range.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 17
(2,667 Views)

there lives the classic color ramp control in the classic palette 

 

however, this can be combined only with a vertical not a horizontal slider...

 

 

3color-slider.gif

Download All
0 Kudos
Message 8 of 17
(2,643 Views)

@paul_cardinale wrote:

wiebe@CARYA wrote:

I suppose the logic is that these meters resemble physical meters, and as the needle makes a circle, the meter has to stay to ratio...

 

You can replace a slider's background with a gradient decoration (2 colors only):

 

wiebeCARYA_1-1648554508623.png

 

Or a custom PNG (pixelated)...

 

Otherwise I guess you'll have to use a picture control and\or an XControl...


Can't just put an image on the background because I need the ramp data to be updated from a DB.


So... Even if the ratio wasn't fixed, you couldn't have used the meter? 🙄

 

Or is there a way to dynamically change the colors of the meter?

0 Kudos
Message 9 of 17
(2,611 Views)

Hi Paul,

 


@paul_cardinale wrote:
Can't just put an image on the background because I need the ramp data to be updated from a DB.

Once I used an array of colorboxes to simulate a colorramp. You can make those colorboxes very small (in width or height). Then I added some VIs to create different kind of colorramps…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(2,587 Views)