Skip to content

Commit a923c69

Browse files
kendo-botKB Botxristianstefanovyordan-mitev
authored
Added new kb article radialgauge-center-label (#2497)
* Added new kb article radialgauge-center-label * Update knowledge-base/radialgauge-center-label.md Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com> --------- Co-authored-by: KB Bot <kb-bot@telerik.com> Co-authored-by: Hristian Stefanov <72554148+xristianstefanov@users.noreply.github.com> Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com>
1 parent efb1b6a commit a923c69

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Adding a Center Label in the RadialGauge
3+
description: This article demonstrates how to add and center a label on the RadialGauge component in a Blazor application.
4+
type: how-to
5+
page_title: How to Center a Label on a RadialGauge in Blazor Applications
6+
slug: radialgauge-center-label
7+
tags: radialgauge, blazor, label, center, css, positioning
8+
res_type: kb
9+
ticketid: 1669777
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product</td>
18+
<td>RadialGauge for Blazor</td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
23+
24+
## Description
25+
26+
How to add a centered label to the RadialGauge component?
27+
28+
## Solution
29+
30+
To add and center a label on the RadialGauge, wrap the RadialGauge inside a `div` element and use a `span` element for the label. Afterward, apply CSS styles to these elements for appropriate positioning.
31+
32+
````RAZOR
33+
<div style="position: relative; width: 500px; height: 300px;">
34+
<TelerikRadialGauge>
35+
<RadialGaugeScales>
36+
<RadialGaugeScale>
37+
<RadialGaugeScaleRanges>
38+
<RadialGaugeScaleRange From="10" To="20" Color="red"></RadialGaugeScaleRange>
39+
</RadialGaugeScaleRanges>
40+
</RadialGaugeScale>
41+
</RadialGaugeScales>
42+
<RadialGaugePointers>
43+
<RadialGaugePointer Value="20"></RadialGaugePointer>
44+
</RadialGaugePointers>
45+
</TelerikRadialGauge>
46+
47+
<!-- Label centered under the Radial Gauge -->
48+
<div style="position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); text-align: center;">
49+
<span style="font-size: 16px; color: #333;">100 HRS</span>
50+
</div>
51+
</div>
52+
````
53+
54+
## See Also
55+
56+
- [Radial Gauge Overview](https://docs.telerik.com/blazor-ui/components/gauges/radial/overview)

0 commit comments

Comments
 (0)