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

Gauge with negative values

1 Answer 115 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonas Karlsson
Top achievements
Rank 1
Jonas Karlsson asked on 26 Feb 2013, 11:26 PM
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>

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 27 Feb 2013, 10:04 AM
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.
Tags
Gauge
Asked by
Jonas Karlsson
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or