I have had a few people ask me about using the RadChart in the same manner as Performance Monitor (aka PerfMon). If you are not familiar with PerfMon, it is a tool that has been provided with Microsoft Windows for quite some time. You can open PerfMon by clicking the Start button within Windows, typing “perfmon” in the search box and pressing Enter. PerfMon is a simple utility that displays performance counters. There are a wide variety of counters available, from CPU utilization of process threads to how many times the .NET Garbage Collector has run. The counters PerfMon allows you to monitor can also be accessed via the .NET framework. Actually, you can create your own custom performance counters for your applications as well, but that is not what this post is about. Essentially the desire being expressed is the ability to use RadChart display running data.
Before I go any further, I would like to point out that the RadChart is not necessarily built to present data in a real time scenario. That being said, it does not mean you cannot accomplish the task with RadChart. Essentially the RadChart is made up of a collection of Series which allow you to add Items to represent a value on the chart. I figured what better way to show that you can use the RadChart to display running data like PerfMon than to show the same information as PerfMon. So I am running a Dual Core Intel processor which allows me to monitor CPU 0, CPU 1 and/or the Total CPU performance counters. In the screenshot below, you will see three (3) entries in the legend and three(3) lines on the chart. These represent the Series portion of the RadChart that I just mentioned. The peaks and valleys of each line are Items which represent the values of the performance counters.
Since I am providing the sample project below, I will not go into the details of the code. I would like to mention a couple of things that you might take into consideration if you plan to use the RadChart in this manner.
The example application provided below is a rough version and does not necessarily represent optimal coding practices