Gauge component

Awesome thanks. Quick question, how do I get a title on it?

I see you are using the 1.0.4 version. I went crazy and added 5 new parameters in a 1.0.6 release so my code for the above is:- new-udgauge -ValueText "Raised Calls: 50" -Segments 6
obviously the 50 would contain your variable that you are holding for the value.
If you open the function .ps1 file you will see all the parameters…I will try and blog this which will explain this component in more detail…as this was done inbetween other things yesterday, didn’t really have time to document it all.
So head back to the powershell gallery to get that version…I will update it again today to 1.0.7 to include the width and height parameters.

What do you think?

1 Like

Sweet man you nailed it. Well done to you :sunglasses: I have now modified the component to include a width and height parameter. This demo is in a size 3 column and is just using the command I copied and pasted in an earlier comment for you. I am not setting the height or width it is just using the defaults. You should be able to now squeeze in that 3rd gauge

Thanks for this challenge, been the most dependencies I ever used in a custom component project. I will update this comment with the link once I get it posted to the powershell gallery.

Greetings…ok version 1.0.7 is now on the powershell gallery:-

remember you do have the ability to adjust font size and font size for the label as well as the vertical and horizontal padding. Peace

Great job and thank you very much. I reckon you’re ready to tackle this one now :stuck_out_tongue:

I know @BoSen29 is working on that component, I had a feeling that would be super-complicated, so kind of side-stepped that request.
I just wanted to let you know there is version 1.0.8 out now, as I used this today at work, and had lots of decimal places showing…so I formatted it to a whole number, I also added another parameter, -SegmetLabels which you have to specify a number, if you do not include this no text numbers will be shown on the outer gauge. You can now have 10 segments only showing 3 segment labels if you get me…I might look at adding the fluid width to, as had to adjust values on width and height for laptop users…

1 Like

Hi @psDevUK, any idea how I can change the text color? I’ve tried playing with the css but can’t seem to find the right options.


Hello @Alc didn’t really overly think about this…however having looked at the site for this component, it does indeed look like I can set a textColor prop.
Having looked at the CSS this is being set in the segment-value and current-value class. But I couldn’t seem to get my CSS colours applying to it using these classes. So will most likely release a 1.0.9 as soon as I can which will include a -textColor parameter which will then set the text colour accordingly.

Ok I have now added the -TextColor parameter, I have also uploaded this as 1.0.9 to the powershell gallery here:- just to prove it does work
I set the default number of segments to 5 and the default colour of the text to #A7A7A7

Awesome, thanks @psDevUK.

Next questions :smiley:


  1. We are using this to show our current SLA result… is it possible to set a segment at specific points? So for example we have a SLA of 95% so would like to have 2 segments - below 95% (red) and above 95% (green).

  2. Is it possible to set a MinValue? We are very unlikely to get below 70% so it would be nice to reduce the gauge down to only show between 70 and 100 in order to show more granularity.

Thanks for your work on this!

Hello again, when I looked at the documentation it did indeed look like you could set specific Segments and for a specific value. Then it looked like you needed to pass a custom set of colours for those defined segment intervals. From the examples it looked like either one way or the other. I decided on the other. As to me made component more flexible. I can look into seeing if this is possible but won’t be soon as got a lot on atm

Hey @psDevUK it would be great if you could but no worries if not.

Quick question - how could I add a line break in to the title so it goes over 2 lines?

Here is what I have finished at 01:24 o’stupid clock…

Using the following:-

new-udgauge -ValueText "Raised Calls: 333" -width 380 -Height 228 -Value 333 -MaxValue 1000 -TextColor "#fff" -CustomStops 0, 500, 750, 900, 1000 -SegmentColors "firebrick", "tomato", "gold", "limegreen"

As for splitting the bottom text over two lines…there is no mention in the documentation I see for this…will update this link again when I posted to PS gallery version 1.1.0 I think it will be… but off to bed now…


@psDevUK you are a legend. That’s awesome! Thank you very much

1 Like

Well I finally had sometime today to do a quick test, and this broke the current way, so I couldnt have two guages side by side one being the standard and one having custom stop segments…so i fiddled with the funtion and made sure is was optional, but it still didnt work…so I thought a few swear words in my head…then thought just publish it as different module name so here is the link to it


Hey @psDevUK I’m struggling to get the custom gauge to work - can you post an example command please?

The code example is below the picture I posted…so you need to make sure you are passing the -CustomStops as integer numbers in an array, and the same number of custom colours for the amount of custom stop points…you also need to specify the -Max value. And instead of New-UDGauge it is New-UDCustomGauge as this broke the original one…I hope this is enough information to now use this component…let me know if I can assist more.

1 Like

I think I’m being stupid. I copied your code above and changed it to new-udcustomgauge. So the code is

new-udcustomgauge -Id "responsegauge" -ValueText “Raised Calls: 333” -width 380 -Height 228 -Value 333 -MaxValue 1000 -TextColor "#fff" -CustomStops 0, 500, 750, 900, 1000 -SegmentColors "firebrick", "tomato", "gold", "limegreen"

But on my dashboard I get the error

Cannot process argument transformation on parameter ‘NeedleColor’. Cannot convert value to type System.String.

If I then add -needlecolor white I get the error

Cannot process argument transformation on parameter ‘Segments’. Cannot convert the “System.Object” value of type “System.Object” to type “System.Int32”.

I will download the module from psgallery and test this myself…at work atm but I will post an update later…to try and make it more realistic I will place some dynamic values in there…you shouldn’t need to specify the needle colour as I done that in the function…I know it worked so will investigate this I used firefox to test in, but the previous gauge works fine in IE at my workplace…so give me time to finish work then will update.

No rush, your help is greatly appreciated :slight_smile:

I downloaded the copy from the gallery, and had same issues as you. So looks like something wrong with this even though worked fine when I originally built it…but I did have to rebuild it again once I realised it messed up the original…