or
If my RadSemicircleNorthScale has a Min=0 and a Max=100, the 100 text will extended outside of the boundaries of the control making it look a little odd. Is there any way to bring in the end tick so that the text "100" would stay within the boundaries of the gauge?
Cheers, Rob.
<
telerik:RadSemicircleNorthGauge
Grid.Row
=
"1"
Style
=
"{StaticResource RadSemiCircleNorthGaugeStyle}"
>
<
telerik:RadialScale
x:Name
=
"radialScale"
MajorTickStroke
=
"{StaticResource BackgroundBlack}"
Foreground
=
"{x:Null}"
MiddleTickStroke
=
"{x:Null}"
MiddleTickBackground
=
"{x:Null}"
MajorTickBackground
=
"{x:Null}"
MinorTickBackground
=
"{x:Null}"
MinorTickStroke
=
"{x:Null}"
>
<
telerik:RadialScale.Ranges
>
<
telerik:GaugeRange
Min
=
"0"
Max
=
"32"
TickBackground
=
"{StaticResource ControlGreen}"
Background
=
"{StaticResource BackgroundBlack}"
StartWidth
=
"0.15"
EndWidth
=
"0.15"
/>
<
telerik:GaugeRange
Min
=
"34"
Max
=
"65"
TickBackground
=
"{StaticResource ControlGreen}"
Background
=
"{StaticResource ControlGreen}"
StartWidth
=
"0.15"
EndWidth
=
"0.15"
/>
<
telerik:GaugeRange
Min
=
"67"
Max
=
"100"
TickBackground
=
"{StaticResource ControlGreen}"
Background
=
"{StaticResource BackgroundBlack}"
StartWidth
=
"0.15"
EndWidth
=
"0.15"
/>
</
telerik:RadialScale.Ranges
>
<
telerik:RadialScale.Indicators
>
<
telerik:Needle
IsAnimated
=
"True"
Value
=
"91"
Style
=
"{StaticResource GaugeNeedleStyle}"
/>
</
telerik:RadialScale.Indicators
>
</
telerik:RadialScale
>
</
telerik:RadSemicircleNorthGauge
>
public
partial
class
TestView : UserControl
{
public
TestView ()
{
InitializeComponent();
this
.Loaded +=
new
RoutedEventHandler(TestView _Loaded);
}
void
TestView _Loaded(
object
sender, RoutedEventArgs e)
{
this
.Dispatcher.BeginInvoke(() =>
{
this
.GaugeRadialScale.Ranges.Add(
new
GaugeRange() { Min = 0, Max = 32, Background =
new
SolidColorBrush(Colors.Magenta), StartWidth = 0.15, EndWidth = 0.15, TickBackground =
new
SolidColorBrush(Colors.Blue) });
this
.GaugeRadialScale.Ranges.Add(
new
GaugeRange() { Min = 34, Max = 65, Background =
new
SolidColorBrush(Colors.Magenta), StartWidth = 0.15, EndWidth = 0.15, TickBackground =
new
SolidColorBrush(Colors.Blue) });
this
.GaugeRadialScale.Ranges.Add(
new
GaugeRange() { Min = 67, Max = 100, Background =
new
SolidColorBrush(Colors.Magenta), StartWidth = 0.15, EndWidth = 0.15, TickBackground =
new
SolidColorBrush(Colors.Blue) });
});
}
}
<
telerik:RadSemicircleNorthGauge
OuterBorderBrush
=
"Transparent"
OuterBackground
=
"Transparent"
InnerBorderBrush
=
"Transparent"
InnerBackground
=
"Transparent"
Foreground
=
"{StaticResource TextBrush}"
Margin
=
"0,0,0,5"
>
<
telerik:SemicircleNorthScale
Center
=
"0.5,1"
Radius
=
"0.9"
MajorTickStep
=
"20"
Foreground
=
"{StaticResource TextBrush}"
FontSize
=
"9"
StartAngle
=
"190"
SweepAngle
=
"160"
>
<
telerik:SemicircleNorthScale.Indicators
>
<
telerik:Needle
Name
=
"Needle"
Background
=
"{StaticResource SelectedBrush}"
IsAnimated
=
"True"
Duration
=
"00:00:00.5"
TooltipFormat
=
" {Value|F1} %"
/>
<
telerik:BarIndicator
x:Name
=
"BarIndicator"
Background
=
"{StaticResource ShiftAbsenceBrush}"
Value
=
"{Binding Value, ElementName=Needle}"
/>
<
telerik:Pinpoint
Background
=
"{StaticResource SelectedBrush}"
BorderBrush
=
"{StaticResource SelectedBrush}"
/>
</
telerik:SemicircleNorthScale.Indicators
>
</
telerik:SemicircleNorthScale
>
</
telerik:RadSemicircleNorthGauge
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
ListBox
ItemsSource
=
"{Binding GaugeList}"
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
StackPanel
Orientation
=
"{Binding View}"
></
StackPanel
>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
telerik:RadGauge
Width
=
"280"
Height
=
"160"
IsEnabled
=
"True"
Tag
=
""
x:Name
=
"rdg"
Cursor
=
"Hand"
FontFamily
=
"Calibri"
FontSize
=
"13.333"
>
<
telerik:RadGauge
x:Name
=
"RadialGauge1"
IsEnabled
=
"{Binding IsGaugeEnabled}"
Tag
=
"1"
Cursor
=
"Hand"
>
<
telerik:RadialGauge
Style
=
"{StaticResource NewGaugeStyle}"
Background
=
"{x:Null}"
BorderBrush
=
"{x:Null}"
OuterBackground
=
"{x:Null}"
OuterBorderBrush
=
"#FF1E212A"
x:Name
=
"RadialGauge1VR"
>
<
telerik:RadialScale
Style
=
"{StaticResource RadialScaleHalfCircleNStyle}"
Min
=
"{Binding Min}"
Max
=
"{Binding Max}"
MajorTickStep
=
"{Binding MajorTickStep}"
LabelRotationMode
=
"None"
FontWeight
=
"Normal"
x:Name
=
"RadialScale1"
Radius
=
"1.6"
EndWidth
=
"0.4"
StartWidth
=
"0.4"
StartAngle
=
"181"
SweepAngle
=
"177"
MiddleTicks
=
"5"
MinorTicks
=
"2"
>
<
telerik:RadialScale.MiddleTick
>
<
telerik:MiddleTickProperties
Background
=
"White"
Location
=
"CenterOutside"
Length
=
"0.12"
TickWidth
=
"0.08"
/>
</
telerik:RadialScale.MiddleTick
>
<
telerik:RadialScale.Label
>
<
telerik:LabelProperties
Format
=
"{}{0:F1}"
Location
=
"CenterInside"
FontSize
=
"16"
Offset
=
"0.25"
/>
</
telerik:RadialScale.Label
>
<
telerik:RadialScale.MajorTick
>
<
telerik:MajorTickProperties
Length
=
"0.4"
Location
=
"CenterInside"
Background
=
"White"
Offset
=
"-0.15"
TickWidth
=
"0.05"
/>
</
telerik:RadialScale.MajorTick
>
<
telerik:RangeList
FontWeight
=
"Normal"
>
<
telerik:RadialRange
x:Name
=
"1"
StartWidth
=
"0.3"
EndWidth
=
"0.3"
Location
=
"OverCenter"
BorderBrush
=
"{x:Null}"
Min
=
"{Binding Min}"
Max
=
"{Binding Max1}"
Background
=
"Transparent"
/>
<
telerik:RadialRange
x:Name
=
"2"
StartWidth
=
"0.3"
EndWidth
=
"0.3"
Location
=
"OverCenter"
BorderBrush
=
"{x:Null}"
Min
=
"{Binding Max1}"
Max
=
"{Binding Max2}"
Background
=
"Transparent"
/>
<
telerik:RadialRange
x:Name
=
"3"
StartWidth
=
"0.3"
EndWidth
=
"0.3"
Location
=
"OverCenter"
BorderBrush
=
"{x:Null}"
Min
=
"{Binding Max2}"
Max
=
"{Binding Max3}"
Background
=
"Transparent"
/>
</
telerik:RangeList
>
<
telerik:IndicatorList
HorizontalAlignment
=
"Center"
>
<
telerik:Needle
x:Name
=
"gauge1_needle1"
Value
=
"{Binding FirstNeedleValue}"
ArrowBackground
=
"Black"
ArrowBorderBrush
=
"Black"
IsAnimated="True
Background
=
"{x:Null}"
BorderBrush
=
"{x:Null}"
HorizontalAlignment
=
"Stretch"
Style
=
"{StaticResource NewNeedleStyle}"
Location
=
"CenterInside"
RelativeShift
=
"0"
Offset
=
"0.1"
RelativeHeight
=
"0.2"
RelativeWidth
=
"0"
/>
</
telerik:IndicatorList
>
</
telerik:RadialScale
>
</
telerik:RadialGauge
>
</
telerik:RadGauge
>
</
telerik:RadGauge
>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
Grid
>
<
Border
BorderBrush
=
"Red"
BorderThickness
=
"2"
HorizontalAlignment
=
"Left"
>
<
telerik:RadHorizontalLinearGauge
HorizontalAlignment
=
"Left"
Height
=
"100"
Width
=
"325"
Margin
=
"2"
VerticalAlignment
=
"Top"
>
<
telerik:HorizontalLinearScale
Min
=
"0"
Max
=
"100"
MajorTicks
=
"1"
MiddleTicks
=
"1"
MinorTicks
=
"1"
LabelTemplate
=
"{StaticResource EmptyLabel}"
RelativeX
=
"0"
RelativeY
=
"0.2"
/>
<
telerik:HorizontalLinearScale
Min
=
"0"
Max
=
"100"
LabelLocation
=
"Inside"
MajorTickLocation
=
"Inside"
MiddleTickLocation
=
"Inside"
MinorTickLocation
=
"Inside"
RelativeX
=
"0"
RelativeY
=
"0.2"
>
<
telerik:HorizontalLinearScale.Indicators
>
<
telerik:BarIndicator
Value
=
"0"
StrokeThickness
=
"0"
StartWidth
=
"0.06"
IsAnimated
=
"True"
/>
</
telerik:HorizontalLinearScale.Indicators
>
<
telerik:HorizontalLinearScale.CustomItems
>
<
Border
telerik:ScaleObject.Value
=
"50"
Style
=
"{StaticResource CustomScaleBorder}"
/>
</
telerik:HorizontalLinearScale.CustomItems
>
</
telerik:HorizontalLinearScale
>
</
telerik:RadHorizontalLinearGauge
>
</
Border
>