Gauges: How to add a label whose text resizes with the gauge


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Kevin,

Similarly to the state indicators case maybe you'll have to implement some code that resizes those labels during a gauge resize. It will be problematic to use NLength with ParentPercentage as it takes the average size of parent width and height - maybe for fine grained scaling we should implement parentminsize, parentmaxsize, parentwidth and parentheight relative units.


Best Regards,
Nevron Support Team


Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Sorry, I wasn't precise enough. When I said label I didn't mean the scale labels.
I want to add a label showing the gauge value. For example I want to add a label to a radial gauge just below the centre spindle. This label should stay at the same relative position and its size should scale as the gauge is resized.
None of the examples do this as the labels; e.g. RPM on the Car dashboard, are a fixed size and move relative to the centre spindle as the gauge is resized. It doesn't look good!
Please can you give an example on how to achieve this?

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Kevin,
You can use NLength with relative unit (parent percentage) to specify the text size of the gauge label texts - for example:

scale.LabelStyle.TextStyle.FontStyle.EmSize = new NLength(5, NRelativeUnit.ParentPercentage);




Best Regards,
Nevron Support Team


Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Is this possible? I notice that the text size of labels in the examples does not change when the gauges are resized.
Thanks
Kevin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search