Start a new topic

Gauge to work from center of bottom


Playing with GUI IDE while my Nextion Enhance 2.4" is being shipped.

Tried to use the Gauge widget but found that it can only work from the center and therefor i cannot use it.

Working an interface for a ham radio transceiver (BITX40) and would like to use an old style S-meter.

So if possible adapt the Gauge (or any new widget) that i could use to get this accomplished.

Thanks in advance

Ron - PA3FAT


1 person likes this idea



or just a needle with val, length, width and color and x,y.



Have you thought about calculating your two end points on your MCU side

and then simply send a Nextion line command?

then probably need also a refresh of the smeter scale object. To prevent the lines covering the whole scale as time progresses. Not sure yet what is the difference between line/draw. If i read it correct (last days) same paramters.

Thanks for your input !


draw is for boxes, clear now.


When you use a Croped-Image as Gauge-Background, together with the matching Page-Background, you can put the center of your Gauge needle to wherever you like ...

All other is furthermore only a matter of your calculation ... be aware, the Gauge-Object uses a resolution of 360 steps, so you must calculate and scale your values according the range you like to display ... in your example from 40 to 140 ...

(320 KB)
@Gerry - this is based on your feedback. Workaround, but limiting the position where i could place the Smeter. Tnx !

Press above for youtube short video.

Still would like the Gauge to be more flexible. For now i can play around.

sorry, but this is no workaround ...

Every Programming-Language, every Visual-Editor like the Nextion-Editor is, are no "ready to produce your desired output" tools.

The nature of such tools is more like a construction set. And now you can think, what is better to offer,

1. a few relatively univeral usable bricks, which allow you to build up nearly everything you like

2. many 1000 customized and special briks, one for a given special purpose ...

When you take 2. what is the result?

- a big bloated Editor

- big bloated compilables

- tons of functions where you really must read the handbook carefully to find yours, and to catch the slight difference between the one you want and maybe 10 others who do a similar customized thing

Keep in mind, the Nextion is no full blowen PC with all its GB of RAM and additional supporting hardware ...

Embedded world has a little other rules ... and you have to deal with limitations everywhere you use embedded devices ...

User wishes are endless ...

- triangle shaped buttons (maybe a simple picture with a hotspot does it? Workaround?)

- oval hotspots (maybe just 4 clever positioned hotspots do same? Workaround?)

- Alpha Channel support (maybe a clever use of your Photoshop first does it? Workaround?)

- Font antialiasing ... (mhmhmh even in the most simple external Graphics Programm I can do it and just embedd the graphic ... Workaround?)

- ...

Many suggestions are great, but many also don't make a big sense, because you exactly can already do what you want to reach with existing briks and your knowledge HOW to stick your needed bricks together ...

The Gauge works exactly as it was designed for. A full range 360' view to fit universally most needs. And you even can decide to only use upper or lower half ... That's what the Crop-Image technology was implemented for ... and that's no workaround, this is a legitimit usage of what you have ...

The fact, that every Gauge needs its square-space, even you only use visually the upper half, is nothing to blame the Object for, it is up to you to choose a clever design to face this ...

Every more would result in more bloated software, more options, more commands, more objects ... and most people already have a problem to read and understand the working of the VERY few existing commands and objects (below 35) or to catch the nature of something given and reuse it in a different way ...  :-)

- it is NOT forbidden to use a text-entry also as a hotspot area only because its name is NOT hotspot ...

- it is NOT forbidden to use a button as label ... if it is comfortable ...

And I never would call this a workaround ... it is rather a slick usage of what you have ... to reach a given goal ...

The quality of your output is not determined by the used tool itself, it is determined by the way you can handle your tool.

Catch the possibilities, take the challenge to use your Nextion. And you will see, there is MUCH more possible as people may see on the first glance ...

For your scenario, I alrady have 4 solutions in mind, how to do exactly what you like to do ...

- 1 uses the real Gauge (as already showen) with visual position limits

- 3 even don't use any Gauge, are more accurate in resolution, and even without visual position limits

And when I already can choose out of 4, is there a real need for a 5th customized and spezialized?

Have fun and MERRY Xmas to you


Not aware i pushed the wrong button.

Playing with the Gui for 2 evenings now. Event scripting is time consuming as the defined syntax in some cases just doesn't work at documented eg. delay(ms) needs to be delay=value.

For me it is a workaround, as now the gauge object needs to be placed within the boundaries of the lcd size.
Placing my meter function now is forced to be on the top half of the screen.
Just enabling the turning point of the gauge to be center or any mid of the sides would increase it functionality. Or just skip the lcd boundaries vs the gauge positioning verification would enable any usage. Then what go's beyond the boundaries is just not there also ok for me. Then it would be a needle in any size.

I am aware at present we need to stick to the limitation of the power of the lcd card.

Also bought an IPS 2.4" full screen without any of these Nextion lcd Gui benefits. So i am already happy with what is available.But if some enhancements could be made it would become more flexible.

The line function is for sure another option, but as the lcd is still in transit, cannot connect, test and investigate in full. Will for sure give it a try when in operation.

Still very thankful for you help.

Merry Christmas Gerry to you and your family.


Hi Ron,

just to prove you a bit wrong. :-)

I just used my small example and enhanced it a bit ...

- 4 Gauges

- all seamless at the displays 4 corners

- no waste of any visual space ...

- ...

what I didn't show, BUT easy to do

- different needle colors according to the values

- different needles shape, yes, not only a plain line is possible

- different sizes of instruments

- even mixed 90,180,270 deg turned instruments at same time

- no limit in number of instruments, without any speed issue

- ...

just to give you some ideas ...

The fact, that somebody don't know the way, does not mean there is no way ... and in fact, I would't call this all a "workaround"

And 30 minutes work on this is really nothing to justify a new enhanced Gauge-Object to do exactly the same ...  :-)

I only upload the film to show you that it works ... that it can be done easily ... have fun ...

And also a happy christmas time to you and your family ...


Looking great. Checked all my visible options, checked the instruction set. No idea how to get the gauge in half mode so could use the bottom. Maybe missing options screen, using as installed. Probably base picture is having 4 meters on it.

Must be missing tip?


Is it ok the gauge only has square shape? w and h are equal, can only draw square gauges.
Documentation states you can change the values or drag the side lines, but only get squares. Whatever i try.
Or are there maybe more settings i just can't see (yet)?


 hehehehe where is the sense of a non square area of any gauge? The Gauge-Object offers a full circle range of 360' ... and a circle is perfect surrounded by a square of its diameter.

If you would use a rectangular shape of a different aspect ratio (dd or dr, oval instead of circle) you would run automatically into the issue of different needle length to fit ...

The Gauge-Object is most universal in the way it is designed for most cases. A full 360' circular range. Not every user like only to use the upper half of value range ...

And no, you didnt oversee any, you didn't miss any option.

But as long as you concentrate on the Gauge-Object, because its name implement that it is the only object which is by definition allowed to be a Gauge, you miss the obviouse :-)

As already explained, go away from the term "workaround" and start use what you have in the way which makes sense for your goal, and don't try to use everything strictly according to naming rules and conventions.

In the time somebody search for missing properties, wait for the implementation of a spezial customized command-desire, the competitor already realized all and bring the product to market ... and finally nobody cares if he used a "workaround" or not ...

I already gave you all knowledge how to do ... you only must put things logically together ...

Next tip ..... umpf I feel a bit ashamed to offer you only "workarounds" to do exactly what you like to do ... shell I?  :-)

Happy holiday