This is a migrated thread and some comments may be shown as answers.

LinearGauge fine-tuning

3 Answers 70 Views
Gauges (RadialGauge, LinearGauge, BulletGraph)
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 2
Veteran
Marco asked on 31 Mar 2021, 03:04 PM

Hello Telerik,

I'm looking to reproduce one of the gauge of Yahoo finance (see objectiv.jpg) but I'm stuck with my prototype (see actual.jpg) and the following questions !

 

- How to change the text of labels ?

- How to customize the rendering of the needleIndicator and its label ? (In my prototype I can't put the label above the NeedleIndicator with TextOffsetIndicator because it go outside the border of the control and is not drawn)

 

Thank you for your support

Marco Guignard

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Apr 2021, 11:41 AM
Hello, Marco, 


According to the provided screenshot, it seems that you are not using the default design for RadLinearGauge from the gallery options. But you are using a RadLinearGauge with customized default style settings. It would be greatly appreciated if you can share a sample project demonstrating the style settings that you have managed to produce the illustrated design.

As to the questions at hand, note that there is no straight-forward way for changing the text for each label. The LinearGaugeLabels offers the LabelFormat property. Thus, you can control how exactly the scale values represented via the labels to be formatted. You can also adjust the LabelsCount property and thus the text will be automatically recalculated according the gauge's range and number of labels: https://docs.telerik.com/devtools/winforms/controls/gauges/lineargauge/elements/working-with-labels

The LinearGaugeNeedleIndicator allows you to specify the TextOffsetFromIndicator which controls the needle's label's location:

You can fine tune the location offset more precisely in a way that suits your requirements best.

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Marco
Top achievements
Rank 2
Veteran
answered on 06 Apr 2021, 02:32 PM

Hi,

I have tried to attach an archive with a sample project, but it doesn't work on the forum.

- The LabelFormat property could not really cover my case because I have to use a custom formater (1 => "1 Strong Buy"; 2=> "2 Buy") and formatstring doesn't handle this scenarii. Of course, I could cheat by adding some label under the Gauge as I have adjusted the LabelsCount and TicksCount to fix the label on 1,2,3,4,5 value with success.

- I have try using the TextOffsetFromIndicator Property, it's working nice as long the label is not moving outside the area of the Gauge. But It doesn't help much about formatting this label.

Of course, all of these are just "nice to have". My current implementation is okay for delivery.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Apr 2021, 09:49 AM
Hello, Marco, 

I glad to hear that your implementation is okay for delivery. Thank you for the provided feedback and the mentioned "nice to have" features. We will definitely consider it in the future improvement of the control if other customers has similar requests.

However, note that it is not possible to provide custom formatting for each label displayed in the LinearGaugeLabels. Adding a separate RadLabel control at the desired location is the appropriate way that gives you the possibility to display any custom text that you need for every separate tick label.

As to the TextOffsetFromIndicator, indeed, if the indicator text's offset is specified with such a value that moves the text outside the gauge's bounds, the label will disappear. It is also appropriate to use a separate RadLabel next to the needle if the default offset doesn't cover your scenario. 

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Gauges (RadialGauge, LinearGauge, BulletGraph)
Asked by
Marco
Top achievements
Rank 2
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Marco
Top achievements
Rank 2
Veteran
Share this question
or