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

Dynamicly adding a RangeList to a Radial Gauge

1 Answer 57 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 10 Oct 2011, 07:30 PM
I am trying to add ranges to a Radial Gauge.  Code snippet:
RangeList oRangeList = new RangeList();
double nextRangeMinimum = 0;
                     
foreach ( QualitativeRange oRange in _ViewModel.BulletGraphRanges )
{
    RadialRange oRadialRange = new RadialRange();
    oRadialRange.Min = nextRangeMinimum;
    oRadialRange.Max = nextRangeMinimum = oRange.Value;
    oRadialRange.BorderBrush = oRange.Brush;
    oRangeList.Add( oRadialRange );
}


The problem is that RangeList has no .Add member.  How do I add ranges to a RangeList?
Thanks.
Dan

Nevermind.  Duh.  It's oRangeList.Items.Add
All better now.

Dan

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 13 Oct 2011, 07:58 AM
Hello Dan,

You can add ranges to the radial scale using the following code:

private void SetupRange(double newMin, double newMax, Color color)
{
    RadialRange range = new RadialRange()
    {
        Min = newMin,
        Max = newMax,
        StartWidth = 0.1,
        EndWidth = 0.1,
        Background = new SolidColorBrush(color)
    };
 
    radialScale.Ranges.Add(range);
}


Greetings,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Gauges
Asked by
Dan
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Share this question
or