ComponentOne Gauge for UWP
Gauges for UWP Task-Based Help / Adding Labels to the Gauge
In This Topic
    Adding Labels to the Gauge
    In This Topic

    You can add and customize the C1RadialGauge control's labeling in the Properties window, XAML, or through code. Although this topic sets the C1GaugeLabel properties of the C1RadialGauge control, the same steps can be used to customize the C1GaugeLabel of other controls.

    At Design Time

    To add labeling to the C1RadialGauge control in the Properties window at design time, complete the following steps:

    1. Click the C1RadialGauge control once to select it.
    2. Navigate to the Properties window, and click the ellipsis button next to the Decorators item. The Decorators collection editor will open.
    3. Choose C1GaugeLabel in the drop-down list in the top-left of the editor and click the Add button. A C1GaugeLabel decorator will be added to the collection and will be selected.
    4. In the right-side properties pane, set the C1GaugeLabel element's C1GaugeDecorator.Location to 1.
      Set the C1GaugeLabel element's C1GaugeLabel.Interval to 20.

    This will set the control's label.

    In XAML

    To add labeling to the C1RadialGauge control in XAML add the <Gauge:C1GaugeLabel> tag to the <Gauge:C1RadialGauge> tag so that it appears similar to the following:

    Markup
    Copy Code
    <Gauge:C1RadialGauge Height="189" Margin="42,29,188,31" Name="C1RadialGauge1" Width="189">
         <Gauge:C1GaugeLabel Interval="20" Location="1" />
     </Gauge:C1RadialGauge>
    

    In Code

    Right-click the window and select View Code to open the Code Editor. Add code to the main class, so it appears similar to the following:

    Visual Basic
    Copy Code
    Public Sub New()
     InitializeComponent()
         Dim c1gl As New C1.Xaml.Gauge.C1GaugeLabel
         c1gl.Location = 1
         c1gl.Interval = 20
         Me.C1RadialGauge1.Decorators.Add(c1gl)
     End Sub
    

    C#
    Copy Code
    public MainPage(){
     InitializeComponent();
         C1.Xaml.Gauge.C1GaugeLabel c1gl = new C1.Xaml.Gauge.C1GaugeLabel();
         c1gl.Location = 1;
         c1gl.Interval = 20;
         this.C1RadialGauge1.Decorators.Add(c1gl);
     }
    

     

    Run your project and observe:

    The C1RadialGauge control will appear with labeling:

    See Also