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

Numeric Gauge - Font Foreground should change based on value range

1 Answer 46 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Shanmugam
Top achievements
Rank 1
Shanmugam asked on 10 Dec 2010, 11:42 AM
I have tried a lot on this to find out range property for numeric gauge control, its there for linear gauge and others but not for numeric gauge control. I have a criteria to change font color (foreground) base on the value range. please let me know the solution for the same.

here is my code

<telerik:RadGauge x:Name="radGauge"
                          Height="45"
                          VerticalAlignment="Stretch"
                          HorizontalAlignment="Stretch"
                          Margin="-15,0,0,0"
                          BorderThickness="0">
            <telerik:NumericScale Min="0" Width="155" BorderThickness="0" >
                <telerik:IndicatorList BorderThickness="0" >
                    <telerik:NumericIndicator x:Name="numericIndicator"
                                              Format="{}{0:F2}"
                         Foreground="DarkBlue"
                                              Left="0"
                                              Top="0"
                                              Value="{Binding ProjectVisibilityDataProp.Visibility}"
                                              RelativeWidth="1.009"
                                              RelativeHeight="0.99"
                                              Background="White"
                                              BorderThickness="0"
                                              FontSize="45">
                        <telerik:NumberPosition CornerRadius="0" />
                        <telerik:NumberPosition CornerRadius="0" />
                        <telerik:NumberPosition CornerRadius="0"  RelativeWidth="0.5" />
                        <telerik:NumberPosition CornerRadius="0" />
                        <telerik:NumberPosition CornerRadius="0" />
                    </telerik:NumericIndicator>
                </telerik:IndicatorList>
            </telerik:NumericScale>
        </telerik:RadGauge>

Thanks
Shanmugam

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 15 Dec 2010, 08:45 AM
Hello Shanmugam,

The numeric scale does not support the ranges visualization as linear or radial scale, but it supports the range list which contains RangeBase class instances. So, you can use them to specify the range (min and max) and the IndicatorBackground property.
At present, the numeric indicator does not support using range colors directly, but as workaround you can use an IndicatorBase class instance and then bind its background to the Foreground property of the Numeric Indicator.

We have created the PITS issue to implement this feature in future releases. You can track it using the following link:
http://www.telerik.com/support/pits.aspx#/public/silverlight/4343

I have attached a sample solution which changes font color of Numeric Indicator base on the ranges.

Best wishes,
Andrey Murzov
the Telerik team

Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Gauge
Asked by
Shanmugam
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or