WPF LinearGauge element sizes

Posted by: elogsdon on 25 September 2019, 5:36 am EST

  • Posted 25 September 2019, 5:36 am EST

    am setting up a linear gauge to use as a password strength meter. The current gauge looks like the attachment.
    I would like the actual gauge (the colored line) to be thicker and reduce the size of the "empty space" below. The XAML code is my app for the gauge is
           <c1:C1LinearGauge Orientation="Horizontal" Minimum="0" Maximum="60" PointerLength=".3" PointerWidth=".005" PointerFill="Black" PointerOffset="-0.1" Height="40"  BorderThickness="0" Value="5" Grid.Row="0" Grid.Column="0">
    <c1:C1GaugeLabel From="0.0" />
    <c1:C1GaugeRange Fill="Red" To="10" />
    <c1:C1GaugeRange Fill="OrangeRed" From="10" To="20" />
    <c1:C1GaugeRange Fill="Orange" From="20" To="30" />
    <c1:C1GaugeRange Fill="Yellow" From="30" To="40" />
    <c1:C1GaugeRange Fill="YellowGreen" From="40" To="50" />
    <c1:C1GaugeRange Fill="Green" From="50" To="60" />
    </c1:C1LinearGauge>

  • Marked as Answer

    Replied 25 September 2019, 4:45 pm EST

    Hi,

    You can set the C1GaugeRange.Width property value relative to the Gauge height/width. For example, to fill the gauge height you can set the C1GaugeRange.Width = 1 as follows:

    <c1:C1GaugeRange Fill="Red" To="10" Width="1"/>
    <c1:C1GaugeRange Fill="OrangeRed" From="10" To="20" Width="1"/>
    <c1:C1GaugeRange Fill="Orange" From="20" To="30" Width="1"/>
    <c1:C1GaugeRange Fill="Yellow" From="30" To="40" Width="1"/>
    <c1:C1GaugeRange Fill="YellowGreen" From="40" To="50" Width="1" />
    <c1:C1GaugeRange Fill="Green" From="50" To="60" Width="1"/>




    Just in case, for gauge related examples you can refer its product samples from "Documents\ComponentOne Samples\WPF\C1.WPF.Gauge\CS\GaugeSamples"

    Regards,
    Basant
  • Replied 26 September 2019, 1:51 am EST

    Thanks a lot!
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels