Simple Steps to Design a Temperature Monitor Using WPF Radial Gauge | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
WPF Radial Gauge Temperature Indicator

Simple Steps to Design a Temperature Monitor Using WPF Radial Gauge

The Radial Gauge is a data visualization component that helps you visualize numerical values on a radial scale. It has highly customizable features, such as scales, pointers, ranges, and annotations, and allows you to design a dashboard, clock, temperature monitor, speedometer, etc.

In this blog, you will get a quick overview of our WPF Radial Gauge control and its features by designing a temperature monitor application.

To create a temperature monitor, you need the following features in the Radial Gauge control:

  • Scales—To define the temperature scale values in numbers from start to end with tick marks.
  • Ranges—To indicate multiple-colored temperature range indicators.
  • Pointers—To point out the current temperature value.
  • Annotations—To show the current temperature value and info about the design.

This section explains how to design a temperature monitor by customizing the appearance of the Radial Gauge as shown in the following screenshot.

Custom appearance of Radial Gauge
Custom appearance of Radial Gauge

Configuring Radial Gauge in WPF application

Refer to this article to learn how to add Syncfusion controls to Visual Studio projects in various ways. You can also refer to this link to learn about the assemblies required for adding Radial Gauge to your project.

Creating a radial gauge

The Radial Gauge control is entirely configurable in both XAML and in code-behind. The following steps describe the initialization of the Radial Gauge control in XAML:

  • Import the following Radial Gauge control’s namespace in the XAML page.
xmlns:gauge=http://schemas.syncfusion.com/wpf

Or

xmlns:gauge ="clr-namespace:Syncfusion.UI.Xaml.Gauges;assembly=Syncfusion.SfGauge.Wpf"
  • Create an instance of the radial gauge class and add it to the layout that suits your requirements.
<Grid>
  <gauge:SfCircularGauge>
  </gauge:SfCircularGauge>
</Grid>

The gauge elements, such as scales, ranges, pointers, and annotations are arranged relatively using the custom position option to make the gauge responsive in all window sizes.

Add the temperature scale

The first step in designing a temperature monitor is to add scale values as numbers from the minimum, -50, to the maximum, 60, with a specific interval. This is implemented using the scales in the Radial Gauge.

Scales contain a collection of scale elements, and you can add any number of radial scales inside the gauge. A scale contains labels and tick marks, the positions and values of which can be customized. In the Radial Gauge, you can display the temperature labels from -50 to 100 using the StartValue and EndValue properties.

Scales have two types of tick marks, major and minor.

Major ticks have labels and are used to specify the primary value intervals. Minor ticks do not have labels and are used to define the space inside the primary value interval. You can specify the tick’s appearance and position-related properties using the MajorTickSettings and MinorTickSettings properties for a scale.

The intervals of the labels and major ticks can be customized by using the Interval property. Minor ticks can be chosen per interval in a scale using the MinorTicksPerInterval property.

You can customize the position for the scale, ticks, and labels by using corresponding offset properties. Values for offset should be given from 0 to 1 (gauge center position to edge).

<gauge:SfCircularGauge >
            <gauge:SfCircularGauge.Scales>
                <gauge:CircularScale StartValue="-50" EndValue="60" Interval="10" MinorTicksPerInterval="9" LabelStroke="#5b5b5b" 
                                     RangePosition="Custom" TickPosition="Custom" LabelPosition="Custom" ShowRim="False" LabelOffset="0.6" >
                    <gauge:CircularScale.MajorTickSettings>
                        <gauge:MajorTickSetting StartOffset="0.85" EndOffset="0.65" StrokeThickness="1" Stroke="Black" />
                    </gauge:CircularScale.MajorTickSettings>
                    <gauge:CircularScale.MinorTickSettings>
                        <gauge:MinorTickSetting StartOffset="0.85" EndOffset="0.75" StrokeThickness="1" Stroke="Black" />
                    </gauge:CircularScale.MinorTickSettings>
                   </gauge:CircularScale>
            </gauge:SfCircularGauge.Scales>
</gauge:SfCircularGauge>
Radial Gauge with Major & Minor Ticks
Radial Gauge with Major & Minor Ticks

Add temperature range indicator

Once the temperature scale design is completed, you need to add the temperature range indicator to indicate the level of severity of the temperature.

Ranges contain a collection of range elements. You can add any number of ranges inside the scale. A range of the Radial Gauge is a visual element that helps you visualize where a value falls on a radial scale.

Ranges in a radial gauge are used to display a temperature range with different color indications. In this blog design, you can use five ranges for scale to indicate the various levels of temperature.

Every range has start and end values, and these can be specified using the StartValue and EndValue properties.

The length and position of a range can be customized using the outer and inner offset properties, as shown in the following code example. The outer offset properties are used where the range length starts in scale, and inner offset properties are used where the range length ends.

<gauge:CircularScale.Ranges>
          <gauge:CircularRange OuterStartOffset="0.85" OuterEndOffset="0.85"
                  InnerStartOffset="0.65" InnerEndOffset="0.65" StartValue="-50" EndValue="-10" Stroke="#4f91fa" />
          <gauge:CircularRange OuterStartOffset="0.85" OuterEndOffset="0.85"
InnerStartOffset="0.65" InnerEndOffset="0.65" StartValue="-10" EndValue="5" Stroke="#28bce4" />
          <gauge:CircularRange OuterStartOffset="0.85" OuterEndOffset="0.85"
                 InnerStartOffset="0.65" InnerEndOffset="0.65" StartValue="5" EndValue="20" Stroke="#0bbe53" />
         <gauge:CircularRange OuterStartOffset="0.85" OuterEndOffset="0.85"
                 InnerStartOffset="0.65" InnerEndOffset="0.65" StartValue="20" EndValue="30" Stroke="#d4d459" />
        <gauge:CircularRange OuterStartOffset="0.85" OuterEndOffset="0.85"
                 InnerStartOffset="0.65" InnerEndOffset="0.65" StartValue="30" EndValue="60" Stroke="#ff3233" />
</gauge:CircularScale.Ranges>
Temperature Range Indicator
Temperature Range Indicator

Add needle pointer

Next, we need to add a needle pointer to indicate the current temperature value. This can be achieved using the pointer support in the Radial Gauge.

Pointers contain a collection of pointer elements, and you can add any number of pointers inside the scale. There are three types of pointers available for gauges: range pointer, needle pointer, and marker pointer. The value of a pointer is set using the Value property.

needle pointer that is used in a temperature monitor design to point out a value is a highly customizable needle-type element.

The knob (rounded ball on the arrow) and tail (rectangle at the end of the knob) elements of a needle pointer are used to enhance the pointer’s look. The length of a pointer can be customized using the NeedleLengthFactor property.

<gauge:CircularScale.Pointers>     
     <gauge:CircularPointer EnableAnimation="True" Value="{Binding InsideValue}" NeedleLengthFactor="0.77" NeedlePointerStroke="#f7ab9c"
NeedlePointerStrokeThickness="12" TailLengthFactor="0.15" TailFill="#f7ab9c" KnobRadiusFactor="0.08" KnobStroke="#eff2f1" KnobStrokeThickness="5" KnobFill="#e8e8e8" NeedlePointerType="Triangle"/>
</gauge:CircularScale.Pointers>
Temperature Range Indicator with Needle
Temperature Range Indicator with Needle Pointer

Annotate temperature unit and value

Finally, we need to display the current temperature value and info over the gauge. This can be achieved using the annotation support in the Radial Gauge.

Annotations contain a collection of annotation elements, and you can add any number of annotations inside the Radial Gauge. To display the current pointer value in the temperature monitor, use the TextBlock control to display the text value over the radial gauge. You can simply bind the current temperature point value to annotation content text.

The position of annotations can be customized using the Offset and Angle properties. The Offset property is used to move the annotation from the center to the required distance from it, whereas the Angle property places the annotation with an angle direction.

<gauge:SfCircularGauge.Annotations>
                <gauge:GaugeAnnotation Angle="90" Offset="0.6">
                    <gauge:GaugeAnnotation.Content>
                        <Border BorderBrush="#6f6d6d" BorderThickness="2" Background="#babab2" CornerRadius="3">
                            <TextBlock x:Name="text" Text="{Binding InsideValue }"  Foreground="#403f3d" FontSize="16" FontWeight="Bold"  Margin="10,1,10,1" />
                        </Border>
                    </gauge:GaugeAnnotation.Content>
                </gauge:GaugeAnnotation>
                <gauge:GaugeAnnotation Angle="90" Offset="0.3">
                    <gauge:GaugeAnnotation.Content>
                        <TextBlock FontSize="15" Text="Temp. °C" Foreground="#9b9b9b" FontWeight="SemiBold"/>
                    </gauge:GaugeAnnotation.Content>
                </gauge:GaugeAnnotation>
                <gauge:GaugeAnnotation Angle="270" Offset="0.3">
                    <gauge:GaugeAnnotation.Content>
                        <TextBlock FontSize="15" Text="Inside" Foreground="#9b9b9b" FontWeight="SemiBold"/>
                    </gauge:GaugeAnnotation.Content>
                </gauge:GaugeAnnotation>
</gauge:SfCircularGauge.Annotations>

Using the same temperature design, you can monitor the inside and outside temperature by splitting the grid into two columns and adding an “Outside” gauge annotation value.

Single Temperature Indicator for both Inside & Outside
Single Temperature Indicator for both Inside and Outside Monitoring

You can check out the sample project on GitHub.

Conclusion

Syncfusion’s Radial Gauge control for WPF has been designed with flexible UI customization to adapt to your app easily. It includes developer-friendly APIs to increase developers’ productivity. We hope you now have a clear idea of these features.

Feel free to visit the Radial Gauge’s feature tour and documentation to learn more about its features and APIs.

If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Also, try our other samples from this GitHub location.

If you have any questions about this control, please let us know in the comments section below. You can also contact us through our support forumDirect-Trac, or feedback portal. We are happy to assist you!

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed