Skip to content

Commit 53503f1

Browse files
authored
Merge pull request #28 from AsBuiltReport/dev
v0.3.0 public release
2 parents 4c0893e + 907aa7d commit 53503f1

29 files changed

Lines changed: 2157 additions & 229 deletions

AsBuiltReport.Chart/AsBuiltReport.Chart.psd1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.Chart.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.2.0'
15+
ModuleVersion = '0.3.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -69,7 +69,7 @@
6969
# NestedModules = @()
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'New-PieChart', 'New-BarChart', 'New-StackedBarChart'
72+
FunctionsToExport = 'New-PieChart', 'New-BarChart', 'New-StackedBarChart', 'New-SignalChart'
7373

7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7575
# CmdletsToExport = '*'
@@ -127,3 +127,4 @@
127127

128128

129129

130+

AsBuiltReport.Chart/AsBuiltReport.Chart.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ switch ($PSVersionTable.PSEdition) {
55
$architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
66
if ($architecture -eq "Arm64" -or $architecture -eq "Arm") {
77
Write-Verbose "Architecture: ARM (Apple Silicon)"
8-
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar) -Verbose -Debug
8+
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
99

1010
} elseif ($architecture -eq "X64" -or $architecture -eq "X86") {
1111
Write-Verbose "Architecture: x86 (Intel)"
12-
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar) -Verbose -Debug
12+
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
1313

1414
} else {
1515
Write-Verbose "Architecture: Unknown or other architecture"
16-
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar) -Verbose -Debug
16+
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
1717
}
1818
} elseif ($IsLinux) {
1919
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}linux-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)

AsBuiltReport.Chart/Src/Assemblies/Core/mac-osx/dummy

Whitespace-only changes.

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.0] - 2026-03-14
9+
10+
### Added
11+
12+
- Add Signal chart support
13+
- Add support for setting the background color of the chart
14+
- Add documentation example on how to use the modules
15+
16+
### Changed
17+
18+
Update module version to 0.3.0
19+
20+
### Fixed
21+
22+
- Fix issue with the stacked chart not rendering correctly when using certain data sets
23+
- Fix pester test to properly validate the functionality of the module
24+
825
## [0.2.0] - 2026-02-20
926

1027
### Added
@@ -19,4 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1936

2037
### Added
2138

22-
- Initial release of AsBuiltReport Chart, providing basic charting capabilities for AsBuiltReport data visualization
39+
40+
- Initial release of AsBuiltReport Chart, providing basic charting capabilities for AsBuiltReport data visualization
41+
42+

Examples/Example01.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<#
2+
.SYNOPSIS
3+
Example 01 - Basic Pie Chart
4+
5+
.DESCRIPTION
6+
This example demonstrates how to create a basic Pie Chart using the AsBuiltReport.Chart module.
7+
The chart displays a simple breakdown of VM power states across a vSphere environment.
8+
#>
9+
10+
[CmdletBinding()]
11+
param (
12+
[System.IO.DirectoryInfo] $Path = (Get-Location).Path,
13+
[string] $Format = 'png'
14+
)
15+
16+
<#
17+
Starting with PowerShell v3, modules are auto-imported when needed. Importing the module here
18+
ensures clarity and avoids ambiguity.
19+
#>
20+
21+
# Import-Module AsBuiltReport.Chart -Force -Verbose:$false
22+
23+
<#
24+
Since the chart output is a file, specify the output folder path using $OutputFolderPath.
25+
#>
26+
27+
$OutputFolderPath = Resolve-Path $Path
28+
29+
<#
30+
Define the data to be displayed in the chart.
31+
In a real-world scenario these values would come from your infrastructure query.
32+
#>
33+
34+
$ChartTitle = 'VM Power States'
35+
$Values = @(120, 35, 10)
36+
$Labels = @('Powered On', 'Powered Off', 'Suspended')
37+
38+
<#
39+
The New-PieChart cmdlet generates the Pie Chart image.
40+
41+
-Title : Sets the chart title displayed at the top of the image.
42+
-Values : Array of numeric values, one per slice.
43+
-Labels : Array of label strings corresponding to each value.
44+
-Format : Output file format (e.g. png, jpg, svg).
45+
-OutputFolderPath : Directory where the generated chart file will be saved.
46+
-Width : Width of the chart image in pixels.
47+
-Height : Height of the chart image in pixels.
48+
-ColorPalette : Predefined color palette (e.g. Category20, Pastel).
49+
-Filename : Name of the output file (without extension).
50+
#>
51+
52+
New-PieChart `
53+
-Title $ChartTitle `
54+
-Values $Values `
55+
-Labels $Labels `
56+
-Format $Format `
57+
-OutputFolderPath $OutputFolderPath `
58+
-Width 600 `
59+
-Height 400 `
60+
-ColorPalette Category20 `
61+
-Filename 'Example01-PieChart'

Examples/Example02.ps1

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<#
2+
.SYNOPSIS
3+
Example 02 - Pie Chart with Legend, Custom Colors and Border
4+
5+
.DESCRIPTION
6+
This example demonstrates how to create a Pie Chart with additional visual options, including:
7+
- An enabled legend with custom alignment and orientation
8+
- A custom hex color palette
9+
- A chart border
10+
- Adjusted title and label font sizes
11+
- Custom chart dimensions
12+
13+
The chart displays a server operating system distribution report.
14+
#>
15+
16+
[CmdletBinding()]
17+
param (
18+
[System.IO.DirectoryInfo] $Path = (Get-Location).Path,
19+
[string] $Format = 'png'
20+
)
21+
22+
<#
23+
Starting with PowerShell v3, modules are auto-imported when needed. Importing the module here
24+
ensures clarity and avoids ambiguity.
25+
#>
26+
27+
# Import-Module AsBuiltReport.Chart -Force -Verbose:$false
28+
29+
<#
30+
Since the chart output is a file, specify the output folder path using $OutputFolderPath.
31+
#>
32+
33+
$OutputFolderPath = Resolve-Path $Path
34+
35+
<#
36+
Define the data to be displayed in the chart.
37+
In a real-world scenario these values would come from your infrastructure query.
38+
#>
39+
40+
$ChartTitle = 'Server OS Distribution'
41+
$Values = @(85, 60, 30, 15)
42+
$Labels = @('Windows Server 2022', 'Windows Server 2019', 'RHEL 9', 'Ubuntu 22.04')
43+
44+
<#
45+
A custom hex color palette can be used to match corporate branding or improve readability.
46+
Each color corresponds to a slice in the order they appear in $Values.
47+
#>
48+
49+
$CustomColors = @('#0078D4', '#00B7C3', '#E74C3C', '#F39C12')
50+
51+
<#
52+
The New-PieChart cmdlet generates the Pie Chart image.
53+
54+
-Title : Sets the chart title.
55+
-TitleFontSize : Sets the font size of the title in points.
56+
-TitleFontBold : Renders the title in bold.
57+
-Values : Array of numeric values, one per slice.
58+
-Labels : Array of label strings corresponding to each value.
59+
-LabelFontSize : Sets the font size of the slice labels.
60+
-LabelDistance : Controls how far labels are placed from the chart center (0.5-0.9).
61+
-EnableLegend : Enables the legend on the chart.
62+
-LegendAlignment : Positions the legend (e.g. UpperRight, LowerCenter).
63+
-LegendOrientation : Sets legend layout direction (Vertical or Horizontal).
64+
-LegendFontSize : Sets the legend text font size in points.
65+
-EnableChartBorder : Draws a border around the chart area.
66+
-ChartBorderColor : Sets the border color.
67+
-ChartBorderSize : Sets the border thickness in pixels.
68+
-EnableCustomColorPalette : Enables use of the custom color palette.
69+
-CustomColorPalette : Array of hex color strings for each slice.
70+
-Width : Output image width in pixels.
71+
-Height : Output image height in pixels.
72+
-Format : Output file format (e.g. png, jpg, svg).
73+
-OutputFolderPath : Directory where the generated chart file will be saved.
74+
-Filename : Name of the output file (without extension).
75+
#>
76+
77+
New-PieChart `
78+
-Title $ChartTitle `
79+
-TitleFontSize 18 `
80+
-TitleFontBold `
81+
-Values $Values `
82+
-Labels $Labels `
83+
-LabelFontSize 13 `
84+
-LabelDistance 0.7 `
85+
-EnableLegend `
86+
-LegendAlignment UpperRight `
87+
-LegendOrientation Vertical `
88+
-LegendFontSize 12 `
89+
-EnableChartBorder `
90+
-ChartBorderColor Black `
91+
-ChartBorderSize 2 `
92+
-EnableCustomColorPalette `
93+
-CustomColorPalette $CustomColors `
94+
-Width 600 `
95+
-Height 400 `
96+
-Format $Format `
97+
-OutputFolderPath $OutputFolderPath `
98+
-Filename 'Example02-PieChart-Advanced'

Examples/Example03.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<#
2+
.SYNOPSIS
3+
Example 03 - Basic Bar Chart
4+
5+
.DESCRIPTION
6+
This example demonstrates how to create a basic Bar Chart using the AsBuiltReport.Chart module.
7+
The chart displays CPU utilization across a set of ESXi hosts.
8+
#>
9+
10+
[CmdletBinding()]
11+
param (
12+
[System.IO.FileInfo] $Path = (Get-Location).Path,
13+
[string] $Format = 'png'
14+
)
15+
16+
<#
17+
Starting with PowerShell v3, modules are auto-imported when needed. Importing the module here
18+
ensures clarity and avoids ambiguity.
19+
#>
20+
21+
# Import-Module AsBuiltReport.Chart -Force -Verbose:$false
22+
23+
<#
24+
Since the chart output is a file, specify the output folder path using $OutputFolderPath.
25+
#>
26+
27+
$OutputFolderPath = Resolve-Path $Path
28+
29+
<#
30+
Define the data to be displayed in the chart.
31+
In a real-world scenario these values would come from your infrastructure query.
32+
#>
33+
34+
$ChartTitle = 'ESXi Host CPU Utilization (%)'
35+
$Values = @(72, 45, 88, 61, 53)
36+
$Labels = @('esxi-host-01', 'esxi-host-02', 'esxi-host-03', 'esxi-host-04', 'esxi-host-05')
37+
38+
<#
39+
The New-BarChart cmdlet generates the Bar Chart image.
40+
41+
-Title : Sets the chart title displayed at the top of the image.
42+
-Values : Array of numeric values, one per bar.
43+
-Labels : Array of label strings corresponding to each bar.
44+
-LabelXAxis : Label for the X-axis.
45+
-LabelYAxis : Label for the Y-axis.
46+
-Format : Output file format (e.g. png, jpg, svg).
47+
-OutputFolderPath : Directory where the generated chart file will be saved.
48+
-Filename : Name of the output file (without extension).
49+
#>
50+
51+
New-BarChart `
52+
-Title $ChartTitle `
53+
-Values $Values `
54+
-Labels $Labels `
55+
-LabelXAxis 'Host' `
56+
-LabelYAxis 'CPU (%)' `
57+
-Format $Format `
58+
-OutputFolderPath $OutputFolderPath `
59+
-Width 600 `
60+
-Height 600 `
61+
-Filename 'Example03-BarChart'

Examples/Example04.ps1

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<#
2+
.SYNOPSIS
3+
Example 04 - Bar Chart with Advanced Options
4+
5+
.DESCRIPTION
6+
This example demonstrates how to create a Bar Chart with advanced options, including:
7+
- Horizontal bar orientation
8+
- Custom color palette
9+
- Bold title and labels
10+
- Custom axis labels and chart dimensions
11+
- Chart border
12+
13+
The chart displays memory utilization across a set of physical servers.
14+
#>
15+
16+
[CmdletBinding()]
17+
param (
18+
[System.IO.FileInfo] $Path = (Get-Location).Path,
19+
[string] $Format = 'png'
20+
)
21+
22+
<#
23+
Starting with PowerShell v3, modules are auto-imported when needed. Importing the module here
24+
ensures clarity and avoids ambiguity.
25+
#>
26+
27+
# Import-Module AsBuiltReport.Chart -Force -Verbose:$false
28+
29+
<#
30+
Since the chart output is a file, specify the output folder path using $OutputFolderPath.
31+
#>
32+
33+
$OutputFolderPath = Resolve-Path $Path
34+
35+
<#
36+
Define the data to be displayed in the chart.
37+
In a real-world scenario these values would come from your infrastructure query.
38+
#>
39+
40+
$ChartTitle = 'Physical Server Memory Utilization (%)'
41+
$Values = @(91, 67, 78, 55, 83, 44)
42+
$Labels = @('srv-prod-01', 'srv-prod-02', 'srv-prod-03', 'srv-dev-01', 'srv-dev-02', 'srv-test-01')
43+
44+
<#
45+
A custom hex color palette can be used to match corporate branding or improve readability.
46+
Each color corresponds to a bar in the order it appears in $Values.
47+
#>
48+
49+
$CustomColors = @('#E74C3C', '#E67E22', '#F1C40F', '#2ECC71', '#3498DB', '#9B59B6')
50+
51+
<#
52+
The New-BarChart cmdlet generates the Bar Chart image.
53+
54+
-Title : Sets the chart title.
55+
-TitleFontSize : Sets the font size of the title in points.
56+
-TitleFontBold : Renders the title in bold.
57+
-Values : Array of numeric values, one per bar.
58+
-Labels : Array of label strings corresponding to each bar.
59+
-LabelFontSize : Sets the font size of the bar labels.
60+
-LabelBold : Renders the bar labels in bold.
61+
-LabelXAxis : Label for the X-axis.
62+
-LabelYAxis : Label for the Y-axis.
63+
-AreaOrientation : Orientation of the bars (Horizontal or Vertical).
64+
-AxesMarginsTop : Top margin for the chart area as a fraction (0-1).
65+
-EnableChartBorder : Draws a border around the chart area.
66+
-ChartBorderColor : Sets the border color.
67+
-EnableCustomColorPalette : Enables use of the custom color palette.
68+
-CustomColorPalette : Array of hex color strings for each bar.
69+
-Width : Output image width in pixels.
70+
-Height : Output image height in pixels.
71+
-Format : Output file format (e.g. png, jpg, svg).
72+
-OutputFolderPath : Directory where the generated chart file will be saved.
73+
-Filename : Name of the output file (without extension).
74+
#>
75+
76+
New-BarChart `
77+
-Title $ChartTitle `
78+
-TitleFontSize 16 `
79+
-TitleFontBold `
80+
-Values $Values `
81+
-Labels $Labels `
82+
-LabelFontSize 12 `
83+
-LabelBold `
84+
-LabelXAxis 'Memory (%)' `
85+
-LabelYAxis 'Server' `
86+
-AreaOrientation Horizontal `
87+
-AxesMarginsTop 0.15 `
88+
-EnableChartBorder `
89+
-ChartBorderColor Black `
90+
-EnableCustomColorPalette `
91+
-CustomColorPalette $CustomColors `
92+
-Width 700 `
93+
-Height 450 `
94+
-Format $Format `
95+
-OutputFolderPath $OutputFolderPath `
96+
-Filename 'Example04-BarChart-Advanced'

0 commit comments

Comments
 (0)