Re-work of parameters in Set-Format (#400)

This commit is contained in:
jhoneill
2018-07-25 21:36:14 +01:00
parent 51c6a98360
commit 7995503bd3
15 changed files with 283 additions and 156 deletions

View File

@@ -2,13 +2,13 @@ try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
Remove-Item temp.xlsx -ErrorAction Ignore
$data = invoke-sum (Get-Process) company handles,pm,VirtualMemorySize
$data = Invoke-Sum -data (Get-Process) -dimension Company -measure Handles, PM, VirtualMemorySize
$c = New-ExcelChart -Title Stats `
$c = New-ExcelChartDefinition -Title "ProcessStats" `
-ChartType LineMarkersStacked `
-Header "Stuff" `
-XRange "Processes[Company]" `
-YRange "Processes[PM]","Processes[VirtualMemorySize]"
-XRange "Processes[Name]" `
-YRange "Processes[PM]","Processes[VirtualMemorySize]" `
-SeriesHeader "PM","VM"
$data |
Export-Excel temp.xlsx -AutoSize -TableName Processes -Show -ExcelChartDefinition $c
Export-Excel -Path temp.xlsx -AutoSize -TableName Processes -ExcelChartDefinition $c -Show

View File

@@ -6,13 +6,14 @@ $data = @"
A,B,C,Date
2,1,1,2016-03-29
5,10,1,2016-03-29
"@ | ConvertFrom-Csv
"@
$c = New-ExcelChart -Title Impressions `
-ChartType Line -Header "Something" `
$c = New-ExcelChartDefinition -Title Impressions `
-ChartType Line `
-XRange "Impressions[Date]" `
-YRange @("Impressions[B]","Impressions[A]") `
-SeriesHeader 'B data','A data'
-YRange "Impressions[B]" # @("Impressions[B]","Impressions[A]") `
-SeriesHeader 'B data','A data' `
-Row 0 -Column 0
$data |
Export-Excel temp.xlsx -AutoSize -TableName Impressions -Show -ExcelChartDefinition $c
$data | ConvertFrom-Csv | Export-Excel -path temp.xlsx -AutoSize -TableName Impressions
Export-Excel -path temp.xlsx -worksheetName chartPage -ExcelChartDefinition $c -show

View File

@@ -1,6 +1,6 @@
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
Remove-Item *.xlsx
Remove-Item -Path Tools.xlsx
$data = @"
ID,Product,Quantity,Price,Total
@@ -9,13 +9,11 @@ ID,Product,Quantity,Price,Total
12003,Saw,12,15.37,184.44
12010,Drill,20,8,160
12011,Crowbar,7,23.48,164.36
"@ | ConvertFrom-Csv
"@
$xRange = "Product"
$c1 = New-ExcelChartDefinition -YRange "Price" -XRange "Product" -Title "Item price" -NoLegend -Height 225
$c2 = New-ExcelChartDefinition -YRange "Total "-XRange "Product" -Title "Total sales" -NoLegend -Height 225 -Row 9 -Column 15
$c3 = New-ExcelChartDefinition -YRange "Quantity"-XRange "Product" -Title "Sales volume" -NoLegend -Height 225 -Row 15
$yRange="Price"; $c1 = New-ExcelChart -YRange $yRange -XRange $xRange -Title $yRange -Height 225
$yRange="Total"; $c2 = New-ExcelChart -YRange $yRange -XRange $xRange -Title $yRange -Row 9 -Column 15 -Height 225
$yRange="Quantity"; $c3 = New-ExcelChart -YRange $yRange -XRange $xRange -Title $yRange -Row 15 -Height 225
$data |
Export-Excel -ExcelChartDefinition $c1,$c2,$c3 Tools.xlsx -Show -AutoFilter -AutoNameRange -AutoSize
$data | ConvertFrom-Csv |
Export-Excel -Path "Tools.xlsx" -AutoFilter -AutoNameRange -AutoSize -ExcelChartDefinition $c1,$c2,$c3 -Show