This question is locked. New answers and comments are not allowed.
Hi all,
I just created a halfcircle radgauge using the Q1 2010 version.
The problem I have is that my labels get stuck in the border of this gauge (shown in the attached image)
This is the code for my radgauge:
And Location = ScaleObjectLocation.OverInside did not do the trick...
Any help ?
Kind regards,
Gertjan
I just created a halfcircle radgauge using the Q1 2010 version.
The problem I have is that my labels get stuck in the border of this gauge (shown in the attached image)
This is the code for my radgauge:
| RadGauge radgauge = (FindName((e.Result as RadGaugeData).XAMLNaam) as RadGauge); |
| if ((e.Result as RadGaugeData).Visible) |
| { |
| radgauge.Visibility = System.Windows.Visibility.Visible; |
| } |
| else |
| { |
| radgauge.Visibility = System.Windows.Visibility.Collapsed; |
| } |
| RadialGauge gauge = new RadialGauge() |
| { |
| MaxHeight = 100, |
| MaxWidth = 175 |
| }; |
| radgauge.Content = gauge; |
| RadialScale scale = new RadialScale() |
| { |
| Min = (e.Result as RadGaugeData).ScaleMin, |
| Max = (e.Result as RadGaugeData).ScaleMax, |
| //StartAngle = 180, |
| //SweepAngle = 180, |
| IsLogarithmic = false, |
| MajorTickStep = (e.Result as RadGaugeData).TickStep, |
| //MiddleTicks = 5, |
| LabelRotationModeLabelRotationMode = LabelRotationMode.None, |
| Location = ScaleObjectLocation.OverInside |
| }; |
| scale.MiddleTick.Length = 0.08; |
| scale.MajorTick.Length = 0.1; |
| gauge.Items.Add(scale); |
| ColorConverter converter = new ColorConverter(); |
| SolidColorBrush lowcol = converter.getSolidColorBrushFromString((e.Result as RadGaugeData).ColorLow); |
| SolidColorBrush medcol = converter.getSolidColorBrushFromString((e.Result as RadGaugeData).ColorMed); |
| SolidColorBrush highcol = converter.getSolidColorBrushFromString((e.Result as RadGaugeData).ColorHigh); |
| scale.Ranges.Add(new RadialRange() |
| { |
| Min = (e.Result as RadGaugeData).ScaleMin, |
| Max = (e.Result as RadGaugeData).LowTresHold, |
| Location = ScaleObjectLocation.Inside, |
| StartWidth = 0.05, |
| EndWidth = 0.1, |
| Background = lowcol |
| }); |
| scale.Ranges.Add(new RadialRange() |
| { |
| Min = (e.Result as RadGaugeData).LowTresHold, |
| Max = (e.Result as RadGaugeData).HighTresHold, |
| Location = ScaleObjectLocation.Inside, |
| StartWidth = 0.1, |
| EndWidth = 0.15, |
| Background = medcol |
| }); |
| scale.Ranges.Add(new RadialRange() |
| { |
| Min = (e.Result as RadGaugeData).HighTresHold, |
| Max = (e.Result as RadGaugeData).ScaleMax, |
| Location = ScaleObjectLocation.Inside, |
| StartWidth = 0.15, |
| EndWidth = 0.2, |
| Background = highcol |
| }); |
| Needle ndl = new Needle() |
| { |
| Location = ScaleObjectLocation.CenterInside, |
| IsAnimated = true, |
| Value = (e.Result as RadGaugeData).Waarde, |
| //Background = new SolidColorBrush(Colors.Red), |
| TooltipFormat = "{0:F2}" |
| }; |
| var uri = new Uri("/Telerik.Windows.Controls.Gauge;component/Themes/generic.xaml", UriKind.Relative); |
| var dictionary = new ResourceDictionary(); |
| dictionary.Source = uri; |
| if (dictionary.Contains("RadialGaugeHalfCircleNStyle")) |
| { |
| gauge.Style = dictionary["RadialGaugeHalfCircleNStyle"] as Style; |
| } |
| if (dictionary.Contains("RadialScaleHalfCircleNStyle")) |
| { |
| scale.Style = dictionary["RadialScaleHalfCircleNStyle"] as Style; |
| } |
| scale.Indicators.Add(ndl); |
| String RGTitel = (e.Result as RadGaugeData).XAMLNaam; |
| TextBlock TargetBlock = new TextBlock(); |
| if (RGTitel == "rg1") |
| TargetBlock = tb1; |
| else if (RGTitel == "rg2") |
| TargetBlock = tb2; |
| else if (RGTitel == "rg3") |
| TargetBlock = tb3; |
| else if (RGTitel == "rg4") |
| TargetBlock = tb4; |
| else if (RGTitel == "rg5") |
| TargetBlock = tb5; |
| TargetBlock.Text = (e.Result as RadGaugeData).Titel; |
Any help ?
Kind regards,
Gertjan