mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Chart supports multiple X ranges and headers from cells
This commit is contained in:
@@ -219,7 +219,7 @@ function Add-ExcelChart {
|
|||||||
.PARAMETER NoLegend
|
.PARAMETER NoLegend
|
||||||
If specified, turns of display of the key. If you only have one data series it may be preferable to use the title to say what the chart is.
|
If specified, turns of display of the key. If you only have one data series it may be preferable to use the title to say what the chart is.
|
||||||
.PARAMETER SeriesHeader
|
.PARAMETER SeriesHeader
|
||||||
Specify explicit name(s) for the data series, which will appear in the legend/key
|
Specify explicit name(s) for the data series, which will appear in the legend/key. The contents of a cell can be specified in the from =Sheet9!Z10 .
|
||||||
.PARAMETER LegendPosition
|
.PARAMETER LegendPosition
|
||||||
Location of the key, either left, right, top, bottom or TopRight.
|
Location of the key, either left, right, top, bottom or TopRight.
|
||||||
.PARAMETER LegendSize
|
.PARAMETER LegendSize
|
||||||
@@ -349,7 +349,7 @@ function Add-ExcelChart {
|
|||||||
[Switch]$NoLegend,
|
[Switch]$NoLegend,
|
||||||
[Switch]$ShowCategory,
|
[Switch]$ShowCategory,
|
||||||
[Switch]$ShowPercent,
|
[Switch]$ShowPercent,
|
||||||
$SeriesHeader,
|
[String[]]$SeriesHeader,
|
||||||
[Switch]$TitleBold,
|
[Switch]$TitleBold,
|
||||||
[Int]$TitleSize ,
|
[Int]$TitleSize ,
|
||||||
[String]$XAxisTitleText,
|
[String]$XAxisTitleText,
|
||||||
@@ -388,8 +388,16 @@ function Add-ExcelChart {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for ($idx = 0; $idx -lt $chartDefCount; $idx += 1) {
|
for ($idx = 0; $idx -lt $chartDefCount; $idx += 1) {
|
||||||
$Series = $chart.Series.Add($YRange[$idx], $XRange)
|
if ($Yrange.count -eq $xrange.count) {
|
||||||
if ($SeriesHeader.Count -gt 0) { $Series.Header = $SeriesHeader[$idx] }
|
$Series = $chart.Series.Add($YRange[$idx], $XRange[$idx])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$Series = $chart.Series.Add($YRange[$idx], $XRange)
|
||||||
|
}
|
||||||
|
if ($SeriesHeader.Count -gt 0) {
|
||||||
|
if ($SeriesHeader[$idx] -match '^=') {$Series.HeaderAddress = $SeriesHeader[$idx] -replace '^=',''}
|
||||||
|
else {$Series.Header = $SeriesHeader[$idx] }
|
||||||
|
}
|
||||||
else { $Series.Header = "Series $($idx)"}
|
else { $Series.Header = "Series $($idx)"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,11 @@ Install-Module ImportExcel
|
|||||||
|
|
||||||
- Thank you to Conrad Agramont, Twitter: [@AGramont](https://twitter.com/@AGramont) for the `AddMultiWorkSheet.ps1` example. Much appreciated!
|
- Thank you to Conrad Agramont, Twitter: [@AGramont](https://twitter.com/@AGramont) for the `AddMultiWorkSheet.ps1` example. Much appreciated!
|
||||||
- Fixed several more bugs where parametrs were ignored if passed a zero value
|
- Fixed several more bugs where parametrs were ignored if passed a zero value
|
||||||
|
- Fixed bug where chart series headers could not come form a cell refernce (=Sheet1!Z10 now works as a header reference)
|
||||||
|
- Add-Chart will now allow a single X range, or as many X ranges as there are Y ranges.
|
||||||
- Merge-MultipleSheets is more robust.
|
- Merge-MultipleSheets is more robust.
|
||||||
- Set-ExcelRow and Set-ExcelColumn trap attempts to process a sheet with no rows/columns.
|
- Set-ExcelRow and Set-ExcelColumn trap attempts to process a sheet with no rows/columns.
|
||||||
- Help has been proof-read .
|
- Help has been proof-read (thanks to Mrs @Jhoneill !).
|
||||||
|
|
||||||
# What's new 5.3.4
|
# What's new 5.3.4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user