Skip to content

Using Graphs in your plugin

Sneddo edited this page May 21, 2014 · 3 revisions

Since vCheck version, you are now able to add charts to your plugins.

To include a chart, use the New-Chart function to construct an object (or array of objects) that contains the bare minimum to generate a chart.

Datapoints are provided as a hashtable of name/value pairs.

Graph colors and size can be set in Style definition.

For example:

Create a bar chart with title "VMs by OS", containing a breakdown of OS

	$data = @{"Windows"=654;"Other"=140}
	$Chart += New-Chart -data $data -ChartType Bar -Title "VMs by OS"

Create a pie chart displaying the power state of your VMs

	$data = @{}
	$VM | Group-Object PowerState | Foreach { $data.Add($_.Name, $_.Count) }
	$Chart += New-Chart -data $data -ChartType Pie -Title "VMs by state"

Clone this wiki locally