PScribo (pronounced 'skree-bo') Charts is an open source project that provides a PowerShell facade over the
[System.Windows.Forms.DataVisualization.Charting]
.NET library. PScribo Charts provides a set of functions for
authoring charts and graphs in Windows PowerShell for use in documentation and/or web pages, e.g. with
PScribo.
Due to its reliance on the [System.Windows.Forms.DataVisualization.Charting]
namespace, this module only works on Microsoft Windows devices. However, both Windows PowerShell and PowerShell (Core) are supported on Microsoft Windows.
Requires Powershell 3.0 or later.
The following example creates a line chart of the highest 10 process WorkingSet properties and exports a .PNG file to the desktop.
Import-Module PScriboCharts
$sampleData = Get-Process | Sort-Object -Property WS -Descending | Select-Object -First 10
$exampleChart = New-Chart -Name Example1 -Width 600 -Height 600
$addChartSeriesParams = @{
Chart = $exampleChart
ChartArea = Add-ChartArea -Chart $exampleChart -Name exampleChartArea -PassThru
Name = 'exampleChartSeries'
XField = 'ProcessName'
YField = 'WS'
}
$sampleData | Add-LineChartSeries @addChartSeriesParams
Export-Chart -Chart $exampleChart -Path ~\Desktop -Format PNG -PassThru
- Automatic (via PowerShell Gallery):
- Run 'Install-Module PScriboCharts'
- Run 'Import-Module PScriboCharts'
- Manual:
- Download and unblock the latest .zip file.
- Extract the .zip into your $PSModulePath, e.g. ~\Documents\WindowsPowerShell\Modules\
- Ensure the extracted folder is named 'PScriboCharts'
- Run 'Import-Module PScriboCharts'
If you find it useful, unearth any bugs or have any suggestions for improvements, feel free to add an issue or place a comment at the project home page.