Skip to content

Repository files navigation

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

AsBuiltReport.Chart

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.1PowerShell 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

# Installinstall-module AsBuiltReport.Chart -Force
# Updateupdate-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

Donut Chart

# Generate a Donut 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-DonutChart-Title 'Test'-Values @(1,2) -Labels @('A','B') -Format 'png'-EnableLegend -Width 600-Height 400-TitleFontSize 20-LabelFontSize 16

DonutChart

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

Single Stacked Bar Chart

# Generate a Single Stacked Bar Chart with the title 'Test', values @(18, 15, 10, 5, 8) for bar 'A' and @(18, 15, 10, 5, 8) 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-SingleStackedBarChart-Title 'Test'-Values @(18,15,10,5,8) -Label 'Workload Type'-LegendCategories @('Category 1','Category 2','Category 3','Category 4','Category 5') -Width 600-Height 200-Format png -AreaOrientation Horizontal -EnableLegend -LegendOrientation Horizontal -LegendAlignment UpperCenter -TitleFontBold -TitleFontSize 20

SingleStackedBarChart

Radar Chart

# Generate a Radar 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-RadarChart-Title 'Test'-Values @(@(1,2,5,8),@(3,5,4,2)) -LegendLabels @('A','B') -Format 'png'-EnableLegend -LegendOrientation Horizontal -LegendAlignment UpperCenter -Filename RadarChart -Width 600-Height 400-SpokeLabels @("Wins","Poles","Podiums","Points") -TitleFontSize 20

RadarChart

📘 Example Index

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

NameDescription
Example1Basic Pie Chart
Example2Pie Chart with Legend, Custom Colors and Border
Example3Basic Bar Chart
Example4Bar Chart with Advanced Options
Example5Basic Stacked Bar Chart
Example6Stacked Bar Chart with Advanced Options
Example7Basic Signal Chart (Line Chart)
Example8Signal Chart with DateTime X-Axis (Time-Series Data)
Example9Signal Chart with Multiple Lines
Example10Basic Single Stacked Bar Chart
Example11Single Stacked Bar Chart with Advanced Options
Example12Basic Donut Chart
Example13Donut Chart with Legend, Custom Colors and Border
Example14Basic Radar Chart with Legend
Example15Radar Chart with Legend, Custom Colors and Border

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

ParameterTypeDefaultDescription
EnableWatermarkSwitch(off)Enables the watermark overlay.
WatermarkTextStringConfidentialText to display as the watermark.
WatermarkFontNameStringArialFont family for the watermark text.
WatermarkFontSizeInt24Font size (points) for the watermark text.
WatermarkColorBasicColorsGrayColor of the watermark text.
WatermarkOpacityDouble0.3Opacity (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 opacityNew-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 fontNew-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 opacityNew-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.

About

AsBuiltReport.Chart is a PowerShell module that aims to provide chart generation capabilities. Underneath it uses ScottPlot and SkiaSharp libraries.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages