Gauge with negative values

2 posts, 0 answers
  1. Jonas Karlsson
    Jonas Karlsson avatar
    8 posts
    Member since:
    Nov 2009

    Posted 26 Feb 2013 Link to this post

    Hello!

    Having some problems with a gauge that has negative values. My range is from -70 to 70.
    Is it possible to set the bar to start from 0 or the middle of the gauge?
    With the code below the bar goes from -70  or left side of the gauge to the value that is set.

    / Jonas
    <gauges:RadialGaugeRange x:Name="range3"
                                        MaxValue="70"
                                        MinValue="-70"
                                        TickStep="10"
                                        LabelStep="20"
                                        LabelRadiusScale="1.68"
                                        TickRadiusScale="1.39"
                                        CenterMode="BottomCenter" Margin="28,0,60,0" >
                       <gauges:RadialGaugeRange.TickTemplate>
                           <DataTemplate>
                               <Rectangle Width="7" Height="1" Fill="{Binding Converter={StaticResource valueToBrushConverter}}"/>
                           </DataTemplate>
                       </gauges:RadialGaugeRange.TickTemplate>
     
                       <gauges:RadialGaugeRange.LabelTemplate>
                           <DataTemplate>
                               <TextBlock Text="{Binding}"
                                  FontSize="13.0"
                                  Foreground="White"
                                  FontWeight="Bold">
                               </TextBlock>
                           </DataTemplate>
                       </gauges:RadialGaugeRange.LabelTemplate>
     
                       <gauges:SegmentedRadialGaugeIndicator gauges:RadialGaugeRange.MaxAngle="180"
                                                            Value="70"
                                                            gauges:RadialGaugeRange.IndicatorRadiusScale="1.33">
                           <gauges:BarIndicatorSegment Thickness="2"
                                                   Stroke="Gray"
                                                   Length="3"/>
                           <gauges:BarIndicatorSegment Thickness="2"
                                                   Stroke="#FF333333"
                                                   Length="7"/>
                           <gauges:BarIndicatorSegment Thickness="2"
                                                   Stroke="Gray"
                                                   Length="3"/>
                       </gauges:SegmentedRadialGaugeIndicator>
     
                       <gauges:RadialBarGaugeIndicator gauges:RadialGaugeRange.MaxAngle="180"
                                                   Value="70"
                                                   BarThickness="12"
                                                   BarBrush="{StaticResource PhoneChromeBrush}"
                                                   gauges:RadialGaugeRange.IndicatorRadiusScale="1.12"/>
     
                       <gauges:RadialBarGaugeIndicator x:Name="indicatorTimingAdvance"
                                                   gauges:RadialGaugeRange.MaxAngle="180"
                                                   Value="-33"
                                                   BarThickness="12"
                                                   BarBrush="{StaticResource PhoneForegroundBrush}"
                                                   gauges:RadialGaugeRange.IndicatorRadiusScale="1.12"
                                                   IsAnimated="True" StartValue="0" />
     
                       <gauges:MarkerGaugeIndicator Value="105"
                                                gauges:RadialGaugeRange.MaxAngle="180"
                                                gauges:RadialGaugeRange.IndicatorRadiusScale="1.12"
                                                MarkerTemplate="{StaticResource starTemplate}">
                       </gauges:MarkerGaugeIndicator>
                   </gauges:RadialGaugeRange>

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 27 Feb 2013 Link to this post

    Hello Jonas,

    Thank you for writing.

    From what I understand you want your bar indicator to start from 0 and increase to the right for positive values and to the left for negative values. Is that correct?

    Currently our radial gauges support negative values in the sense that the radial indicators can increase from right to left only from left to right. The linear gauges however support this behavior.

    Kind regards,
    Victor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top