Generating graphs
There is an old saying that a picture is worth a thousand words, and when reporting on performance numbers, pictures can be significantly more useful than raw numbers. With a performance graph, you can quickly show the utilization of a system, any performance spikes, and when they occur during the day.
To generate our graphs we will be using the System.Windows.Forms.DataVisualization.Charting.Chart
class that is included in .NET Framework 4
and greater on Windows 7 and greater.
Getting ready
In this recipe, we will be using the performance data previously collected in the Configuring Data Collector Sets recipe to generate a graph showing the CPU utilization. The graph will be saved as a PNG file that can be printed, attached to a report, or e-mailed along with the performance report.
How to do it...
Carry out the following steps to generate a graph:
Create a chart object.
$myChart = New-Object ` System.Windows.Forms.DataVisualization.Charting.Chart $myChart.Width = 600 $myChart...