LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi colored Graduated Bar



I'm looking for a way to make a multi colored Graduated Bar.  Basically like the original Slide I've got a picture of.  But basically having three different fill colors.  Green at the bottom.  Yellow in the middle, and red at the top.



I found one post on the boards that could change the entire fill color depending on the level.  But that's not quite what I'm looking for.  


http://forums.ni.com/ni/board/message?board.id=170&message.id=24957&query.id=25463#M24957


Is what I want to do possible?


Message Edited by pallen on 03-20-2008 02:05 PM
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 8
(5,750 Views)
You can do this by adding sliders to the slide (a right click option), and changing the fill color for each slider. You can do this either by using the properties dialog or by using property nodes. Note that you should also use the property nodes to change the fill style for each slider to fill to the value below.

___________________
Try to take over the world!
Message 2 of 8
(5,741 Views)
Cool! 

Thanks for the info.  It took a little bit of messing around to get exactly what I wanted.  But this looks like it'll work for me. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 3 of 8
(5,730 Views)

Thanks for the VI.  This progress bar is going to come in handy for something I want to do.

 

I am reposting it with one modification.  I found that if you were in green or yellow, the red bar would just appear at the very bottom and flicker a bit.  When you moved into red, all looked good.

 

I reordered the 3 sliders so that green was #3, and red was #1.  That way the unused sliders of yellow or red, would appear under the green one and show smooth transition no matter what the level was.

 

Quick question.  Is there a way to control how tall the individual segments of the bar are?  I see if you make the total slider taller, you can get more segments, shorter - less.  But an individual segment is always about 10 pixels tall.  I would like to get a relatively shorter slider with a height of about 60, but have it show up with 15 segments.  So a segment might be 3 pixels high with a 1 pixel separator.

I can't find a property node for this, or a way to customize the control to do this.
Message Edited by Ravens Fan on 11-19-2008 09:57 PM
Message 4 of 8
(5,545 Views)

Hi Ravens Fan,

I do not think there is a property node to do this.  Or at least I have not been able to find one and I looked for quite some time.  I think to do this you will need to create a custom control.  Take a look at this part of the LabVIEW Help for how to get started with this.

Adam H
National Instruments
Applications Engineer
0 Kudos
Message 5 of 8
(5,502 Views)

i have gone through changing_progress_bar.vi but i found some problem in your vi. Here i have attached image which indicates my problem in progress bar. Please do needful.

Problem is when we start a vi then red color is by default present below the 0 limit and if we change the limit to above the certain limit for red color then red color is disappear in stating point.here problem is when i run the vi then by default red color is indicate below the 0here problem is when i run the vi then by default red color is indicate below the 0when limit is above the set limit then red color is gone.when limit is above the set limit then red color is gone.

0 Kudos
Message 6 of 8
(3,566 Views)

I hadn't noticed that issue.  

 

One way of addressing this is with a couple of property nodes.  

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 7 of 8
(3,518 Views)

What timing!  Two days ago, I wanted to make a Slide Control to test an Alarm system I'm developing that will send an alarm if a signal is "too low".  I wanted a slider to generate a test signal, and wanted a visual indicator when I was in the "Danger Zone".  Here's what I came up with:

Flow ControlFlow ControlUsing Flow ControlUsing Flow Control

The first is a picture of the Control on the Front Panel.  It looks like a simple Slider Control, but it actually has two Sliders.  Slider 1 is at 100, and shows the dark blue background to its left.  Slider 2 is initialized at the "Danger" level of 40 (via a Property Node), and has its background set to Red.  But where is it?  It is at 40, of course.  What I did was to grab the corners of Slider 2 and make it as small as possible (so that it couldn't easily be "grabbed" and moved).  I also made it Transparent, so "He Cannot Be Seen" (blooey!). lso 

 

I aIso added the Snippet where I show how I read Slider 1 and use it.  When I went to post this code, I realized that I didn't handle the possibility that I clicked on the "invisible" Slider 2 and moved it by accident, so I added the code to reset the Slider "just in case".

 

Bob Schor

 

0 Kudos
Message 8 of 8
(3,508 Views)