Programatically Created Gauges not showing Scale

2 posts, 0 answers
  1. David Gunderson
    David Gunderson avatar
    13 posts
    Member since:
    Apr 2010

    Posted 28 Apr 2010 Link to this post

    So i have something in the wrong place? Looks right to me but the Scale is still not being displayed.

    Partial Public Class MainPage  
        Inherits UserControl  
        Private autoRange As RadialRange  
        Private AutoRangeR As RadialRange  
        Private AutoRangeY As RadialRange  
        Private autoscale As RadialScale  
        Private autoneedle As Needle  
        Public Sub New()  
            AddHandler Loaded, AddressOf SilverlightControl_Loaded  
        End Sub 
        Private Sub SilverlightControl_Loaded(ByVal sender As ObjectByVal e As RoutedEventArgs)  
            ' create the RadGauge   
            Dim radGauge = New RadGauge()  
            ' add RadGauge to the LayoutRoot   
            ' create the RadialGauge   
            Dim gauge = New RadialGauge()  
            ' add RadialGauge to the RadGauge   
            radGauge.Content = gauge  
            ' create the RadialScale   
            autoscale = New RadialScale()  
            autoscale.Name = "RadialScale22" 
            autoscale.Min = 0  
            autoscale.Max = 100  
            autoscale.MinorTicks = 2  
            autoscale.MiddleTicks = 2  
            autoscale.Radius = 75  
            ' add RadialScale to the RadialGauge   
            Dim RangeList1 = New RangeList()  
            'Create the Range Green  
            autoRange = New RadialRange()  
            autoRange.Name = "Green" 
            autoRange.StartWidth = 0.06  
            autoRange.EndWidth = 0.06  
            autoRange.Min = 90  
            autoRange.Max = 100  
            autoRange.Background = New SolidColorBrush(Colors.Green)  
            'Create the Range Yellow  
            AutoRangeY = New RadialRange()  
            autoRangeY.Name = "Yellow" 
            autoRangeY.StartWidth = 0.06  
            autoRangeY.EndWidth = 0.06  
            autoRangeY.Min = 40  
            autoRangeY.Max = 50  
            autoRangeY.Background = New SolidColorBrush(Colors.Yellow)  
            'Create the Range Red  
            AutoRangeR = New RadialRange()  
            autoRangeR.Name = "Red" 
            autoRangeR.StartWidth = 0.06  
            autoRangeR.EndWidth = 0.06  
            autoRangeR.Min = 0  
            autoRangeR.Max = 10  
            autoRangeR.Background = New SolidColorBrush(Colors.Red)  
            Dim IndicatorList1 = New IndicatorList()  
            ' create the Needle   
            autoneedle = New Needle()  
            autoneedle.Value = 0  
            ' add needle to indicators collection   
        End Sub 
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 29 Apr 2010 Link to this post

    Hi David,

    The problem is in the following line:
    autoscale.Radius = 75

    The Radius property value is a radius of the scale relative to its container. It should be between 0 and 1.
    The correct value would be 0.75.

    Kind regards,
    Andrey Murzov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top