Profile Picture

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

Posted By Kevin Harrison 9 Years Ago

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

Author
Message
Kevin Harrison
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

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
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Is this possible? I notice that the text size of labels in the examples does not change when the gauges are resized.
Thanks
Kevin

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 1 minute ago
Posts: 3,054, Visits: 4,006

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
Posted 9 Years Ago
View Quick Profile
Supreme Being

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
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
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
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 1 minute ago
Posts: 3,054, Visits: 4,006
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





Similar Topics


Reading This Topic