mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
38 lines
1.4 KiB
PowerShell
38 lines
1.4 KiB
PowerShell
function New-ExcelChartDefinition {
|
|
[cmdletbinding()]
|
|
[Alias("New-ExcelChart")] #This was the former name. The new name reflects that we are defining a chart, not making one in the workbook.
|
|
param(
|
|
$Title = "Chart Title",
|
|
$Header,
|
|
[OfficeOpenXml.Drawing.Chart.eChartType]$ChartType = "ColumnStacked",
|
|
$XRange,
|
|
$YRange,
|
|
$Width = 500,
|
|
$Height = 350,
|
|
$Row = 0,
|
|
$RowOffSetPixels = 10,
|
|
$Column = 6,
|
|
$ColumnOffSetPixels = 5,
|
|
[Switch]$NoLegend,
|
|
[Switch]$ShowCategory,
|
|
[Switch]$ShowPercent,
|
|
$SeriesHeader
|
|
)
|
|
if ( $Header ) {Write-Warning "The header parameter is ignored."} #Nothing was done with it when creating a chart.
|
|
[PSCustomObject]@{
|
|
Title = $Title
|
|
ChartType = $ChartType
|
|
XRange = $XRange
|
|
YRange = $YRange
|
|
Width = $Width
|
|
Height = $Height
|
|
Row = $Row
|
|
RowOffSetPixels = $RowOffSetPixels
|
|
Column = $Column
|
|
ColumnOffSetPixels = $ColumnOffSetPixels
|
|
NoLegend = $NoLegend -as [Boolean]
|
|
ShowCategory = $ShowCategory-as [Boolean]
|
|
ShowPercent = $ShowPercent -as [Boolean]
|
|
SeriesHeader = $SeriesHeader
|
|
}
|
|
} |