mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
20 lines
551 B
PowerShell
20 lines
551 B
PowerShell
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
|
|
|
Remove-Item temp.xlsx -ErrorAction Ignore
|
|
|
|
$data = @"
|
|
A,B,C,Date
|
|
2,1,1,2016-03-29
|
|
5,10,1,2016-03-29
|
|
"@
|
|
|
|
$c = New-ExcelChartDefinition -Title Impressions `
|
|
-ChartType Line `
|
|
-XRange "Impressions[Date]" `
|
|
-YRange @("Impressions[B]","Impressions[A]") `
|
|
-SeriesHeader 'B data','A data' `
|
|
-Row 0 -Column 0
|
|
|
|
$data | ConvertFrom-Csv | Export-Excel -path temp.xlsx -AutoSize -TableName Impressions
|
|
Export-Excel -path temp.xlsx -worksheetName chartPage -ExcelChartDefinition $c -show
|