cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Olivier
Advocate V
Advocate V

Level Meter

What control is recommended to create a level meter (as in audio level meter)?  Typically, a progress bar control could be used, but I didn't find such a control in the list.  Could a chart control work (bar graph with one bar)?  Or is something else recommended?  What if I want a tri-colored level meter (green, yellow, red as function of level)?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can use a gallery (custom vertical) with a single shape (Rectangle) inside of it to accomplish that. Here's how you'd go about it:

 

To simulate the input level, add a slider, and set the following properties

Slider1.Min: 0
Slider1.Max: 10
Slider1.Default: 10

Next, add a custom vertical gallery, and resize the template to the size that you want each bar of your meter to look like. Inside the template, add a rectangle (you can find it in the "Shapes" group of the ribbon). Then set the following properties:

Gallery1.Items = [10,9,8,7,6,5,4,3,2,1]
  Rectangle1.Fill = If(ThisItem.Value < 4, Green, If(ThisItem.Value < 8, Yellow, Red))
  Rectangle1.Visible = ThisItem.Value <= Slider1.Value

Setting the gallery items to that value ([10,9,...,1]) will ensure that it will always have 10 elements, and you can use the value to set the property of the rectangle. Once you resize the gallery to ensure that all elements are visible, you can play with the slider to see the level meter in action.

 

The image below shows how it would look like.

LevelMeter.png

You can also create a new idea in the PowerApps Ideas board so that the product group can consider adding this control to the product.

View solution in original post

4 REPLIES 4
hpkeong
Community Champion
Community Champion

hi

 

I would suggest the use of TextBox:

1. 3 TextBox as backgrounds, say in White

2. 3 TextBox as the Level meter, with green, yellow, red color in FILL

3. Set the Height or Width of the Level Meter TextBox using If....to change height or width (depend if you set them as horizontally or vertically) based on your TextInput or any controlling parameter.

 

Width: (Value(TextInput1.Text) / Value(TextBox1.Width)) * Value(TextBox1.Width)

 

TextInput1 can be any either variable input such as Slider,... and set the MAX value as TextBoz1.Width

(So that the Level meter will not go beyond the background).

 

Hope it helps.

hpkeong
CarlosFigueira
Power Apps
Power Apps

You can use a gallery (custom vertical) with a single shape (Rectangle) inside of it to accomplish that. Here's how you'd go about it:

 

To simulate the input level, add a slider, and set the following properties

Slider1.Min: 0
Slider1.Max: 10
Slider1.Default: 10

Next, add a custom vertical gallery, and resize the template to the size that you want each bar of your meter to look like. Inside the template, add a rectangle (you can find it in the "Shapes" group of the ribbon). Then set the following properties:

Gallery1.Items = [10,9,8,7,6,5,4,3,2,1]
  Rectangle1.Fill = If(ThisItem.Value < 4, Green, If(ThisItem.Value < 8, Yellow, Red))
  Rectangle1.Visible = ThisItem.Value <= Slider1.Value

Setting the gallery items to that value ([10,9,...,1]) will ensure that it will always have 10 elements, and you can use the value to set the property of the rectangle. Once you resize the gallery to ensure that all elements are visible, you can play with the slider to see the level meter in action.

 

The image below shows how it would look like.

LevelMeter.png

You can also create a new idea in the PowerApps Ideas board so that the product group can consider adding this control to the product.

View solution in original post

Thank you hpkeong, it will be interesting to see the performance that this would use for a 30 samples per second feed on 8 level meters.  I wonder how powerapps behave on a stream of data vs. just loading records of data.

Thanks for the help.

Thank you Carlos,

It looks like there are quite a few ways to skin that cat. I like your proposed solution and the use of the gallery is pretty cool.  It seems however that if I need a granularity of 50 levels, there would be 50 comparisons that have to be performed on each sample received. I will try your solution, and as I posted in my reply to hpkeong, I wonder how PowerApps will behave performance wise when dealing with a steady stream of data.  What are the ways to have data sources that are constant data streams from a server at a fixed data rate?  Do you have sample apps that demonstrate such a scheme?

Thank you again.

Olivier

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,266)