Skip to content

Latest commit

 

History

History
165 lines (122 loc) · 8.71 KB

File metadata and controls

165 lines (122 loc) · 8.71 KB

Want to keep alive this project? Support me on Ko-fi

AsBuiltReport.Chart

❗ THIS ASBUILTREPORT MODULE IS CURRENTLY IN DEVELOPMENT AND MIGHT NOT YET BE FUNCTIONAL ❗

AsBuiltReport.Chart is a PowerShell module which provides a set of cmdlets for generating charts and visualizations in As Built Reports. This module is designed to work seamlessly with the AsBuiltReport.Core module, allowing users to create visually appealing and informative reports with ease.

🔰 Getting Started

The following simple list of instructions will get you started with the AsBuiltReport.Chart module.

💾 Supported Versions

PowerShell

This report is compatible with the following PowerShell versions;

Windows PowerShell 5.1 PowerShell 7

🗺️ Language Support

The AsBuiltReport Chart supports the following languages;

  • English (US) (Default)

🔧 System Requirements

PowerShell 5.1 or PowerShell 7, and the following PowerShell modules are required for generating an AsBuiltReport Chart.

🔐 Required Privileges

Local user privilege

📦 Module Installation

PowerShell

# Install
install-module AsBuiltReport.Chart -Force

# Update
update-module AsBuiltReport.Chart -Force

💻 Examples

Here are some examples to get you going.

Pie Chart

# Generate a Pie Chart with the title 'Test', values of 1 and 2, labels 'A' and 'B', and export the chart in PNG format. Enable the legend and set the width to 600 pixels, height to 400 pixels, title font size to 20, and label font size to 16.
New-PieChart -Title 'Test' -Values @(1,2) -Labels @('A','B') -Format 'png' -EnableLegend -Width 600 -Height 400 -TitleFontSize 20 -LabelFontSize 16

PieChart

Bar Chart

# Generate a Bar Chart with the title 'Test', values of 1 and 2, labels 'A' and 'B', and export the chart in PNG format. Enable the legend and set the width to 600 pixels, height to 400 pixels, title font size to 20, and label font size to 16.
New-BarChart -Title 'Test' -Values @(1,2) -Labels @('A','B') -Format 'png' -EnableLegend -Width 600 -Height 400 -TitleFontSize 20 -LabelFontSize 16 -AxesMarginsTop 1

BarChart

Stacked Bar Chart

# Generate a Stacked Bar Chart with the title 'Test', values @(1,2) for bar 'A' and @(3,4) for bar 'B' (one inner -Values array per bar matching -Labels), legend categories 'Value1' and 'Value2' for the stacked segments, and export the chart in PNG format. Enable the legend, set the legend orientation to horizontal, align the legend to the upper center, set the width to 600 pixels, height to 400 pixels, title font size to 20, label font size to 16, and axes margins top to 1.
New-StackedBarChart -Title 'Test' -Values @(@(1,2),@(3,4)) -Labels @('A','B') -LegendCategories @('Value1','Value2') -Format 'png' -EnableLegend -LegendOrientation Horizontal -LegendAlignment UpperCenter -Width 600 -Height 400 -TitleFontSize 20 -LabelFontSize 16 -AxesMarginsTop 1

StackedBarChart

📘 Example Index

All examples in the latest release of AsBuiltReport.Chart can be found in the table below.

Name Description
Example1 Basic Pie Chart
Example2 Pie Chart with Legend, Custom Colors and Border
Example3 Basic Bar Chart
Example4 Bar Chart with Advanced Options
Example5 Basic Stacked Bar Chart
Example6 Stacked Bar Chart with Advanced Options
Example7 Basic Signal Chart (Line Chart)
Example8 Signal Chart with DateTime X-Axis (Time-Series Data)
Example9 Signal Chart with Multiple Lines

Watermark Support

All chart types support an optional watermark that overlays semi-transparent text in the center of the chart. The watermark is disabled by default and is activated only when the -EnableWatermark switch is supplied.

Watermark Parameters

Parameter Type Default Description
EnableWatermark Switch (off) Enables the watermark overlay.
WatermarkText String Confidential Text to display as the watermark.
WatermarkFontName String Arial Font family for the watermark text.
WatermarkFontSize Int 24 Font size (points) for the watermark text.
WatermarkColor BasicColors Gray Color of the watermark text.
WatermarkOpacity Double 0.3 Opacity (0.0–1.0) of the watermark. Lower values are more transparent.

Watermark Examples

# Pie chart with default watermark (gray "Confidential" at 30% opacity)
New-PieChart -Title 'Sales' -Values @(10, 20, 30) -Labels @('A', 'B', 'C') -Format 'png' -EnableWatermark

# Bar chart with a custom watermark text, color, and opacity
New-BarChart -Title 'Revenue' -Values @(100, 200, 150) -Labels @('Q1', 'Q2', 'Q3') -Format 'png' `
    -EnableWatermark -WatermarkText 'CONFIDENTIAL' -WatermarkColor Red -WatermarkOpacity 0.2

# Stacked bar chart with a larger watermark font
New-StackedBarChart -Title 'Budget' -Values @(@(1,2),@(3,4)) -Labels @('A','B') -LegendCategories @('X','Y') -Format 'png' `
    -EnableWatermark -WatermarkFontSize 36 -WatermarkText 'DRAFT'

# Signal chart with a custom font and opacity
New-SignalChart -Title 'Throughput' -Values @(,[double[]]@(1,2,3,4,5)) -Format 'png' `
    -EnableWatermark -WatermarkFontName 'Arial' -WatermarkOpacity 0.5

❌ Known Issues

  • No known issues at this time.