Repository navigation
Expand file tree
/
Copy pathExample16.ps1
More file actions
70 lines (59 loc) · 2.14 KB
/
Copy pathExample16.ps1
File metadata and controls
70 lines (59 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<#
.SYNOPSIS
Example 16 - Heat Map Chart
.DESCRIPTION
This example demonstrates how to create a Heat Map Chart using the AsBuiltReport.Chart module.
The chart displays cluster utilization across resource types for multiple clusters.
#>
[CmdletBinding()]
param (
[System.IO.DirectoryInfo] $Path = (Get-Location).Path,
[string] $Format = 'png'
)
<#
Starting with PowerShell v3, modules are auto-imported when needed. Importing the module here
ensures clarity and avoids ambiguity.
#>
# Import-Module AsBuiltReport.Chart -Force -Verbose:$false
<#
Since the chart output is a file, specify the output folder path using $OutputFolderPath.
#>
$OutputFolderPath = Resolve-Path $Path
<#
Define the data to be displayed in the chart.
In a real-world scenario these values would come from your infrastructure query.
#>
$ChartTitle = 'Cluster Utilization'
$Values = @(
@(78, 81, 74),
@(66, 72, 80),
@(88, 91, 85)
)
$RowLabels = @('Cluster A', 'Cluster B', 'Cluster C')
$ColumnLabels = @('CPU', 'Memory', 'Storage')
<#
The New-HeatMapChart cmdlet generates the Heat Map image.
-Title : Sets the chart title displayed at the top of the image.
-Values : 2D matrix of numeric values for the heat map.
-RowLabels : Labels for each row in the heat map.
-ColumnLabels : Labels for each column in the heat map.
-Format : Output file format (e.g. png, jpg, svg).
-OutputFolderPath : Directory where the generated chart file will be saved.
-Width : Width of the chart image in pixels.
-Height : Height of the chart image in pixels.
-Filename : Name of the output file (without extension).
-EnableLegend : Boolean to enable or disable the legend on the chart.
#>
New-HeatMapChart `
-Title $ChartTitle `
-Values $Values `
-RowLabels $RowLabels `
-ColumnLabels $ColumnLabels `
-LabelXAxis 'Resources' `
-LabelYAxis 'Clusters' `
-EnableLegend `
-Format $Format `
-OutputFolderPath $OutputFolderPath `
-Width 700 `
-Height 500 `
-Filename 'Example16-HeatMapChart'