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

RadHorizontalLinearGauge how to add vertical dotted lines ?

5 Answers 123 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Devid
Top achievements
Rank 1
Devid asked on 23 May 2019, 02:30 PM

How can I create a Gauge that looks like the one in the image attached ?

I am using RadHorizontalLinearGauge in Code Behind.

I want to know:

  1. how can I have text/label above the needle indicator ? (pointer).
  2. how can I create trend ? (dotted vertical line)
  3. how can Iinsert a label/text inside the a range ("Schlecht" in the attached image) ?

 

 

 

5 Answers, 1 is accepted

Sort by
0
Devid
Top achievements
Rank 1
answered on 29 May 2019, 02:32 PM
No one ? I guess that I habe to do something with CustomItems
0
Martin Ivanov
Telerik team
answered on 03 Jun 2019, 06:44 AM
Hello Devid,

Yes, this is the way to go. You can add the label above the marker, the labels inside the bars, and also the dotted lines, using the CustomItems collection of the scale. Maybe you already found this, but here is an article showing how to use the collection and position the custom elements. I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Devid
Top achievements
Rank 1
answered on 03 Jun 2019, 08:25 AM

Can you provide a code behind example ? 

horizontalScale.CustomItems.Add(???);

 

0
Devid
Top achievements
Rank 1
answered on 03 Jun 2019, 02:48 PM
Also how do I put labels inside the bars ?
0
Accepted
Martin Ivanov
Telerik team
answered on 05 Jun 2019, 01:24 PM
Hello Devid,

I've attached a small example showing the desired effect. Also, here is an example showing how to add elements in code-behind. 
var label = new TextBlock();
label.Text = "Gut";
label.FontSize = 18;
Panel.SetZIndex(label, 101);
ScaleObject.SetValue(label, 90);
ScaleObject.SetLocation(label, ScaleObjectLocation.OverCenter);
 
this.horizontalScale.CustomItems.Add(label);
I hope it helps.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Gauges
Asked by
Devid
Top achievements
Rank 1
Answers by
Devid
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or