ImportExcel icon indicating copy to clipboard operation
ImportExcel copied to clipboard

Question: How to change outline color of ChartType Line?

Open evild3ad opened this issue 2 years ago • 1 comments

How can I change the outline color of my generated line chart directly with ImportExcel?

I always have to change the standard Microsoft blue colored outline manually.

$Import = Import-Csv "$Output\Logs\UserLoggedIn.csv" -Delimiter "," -Encoding UTF8 $ChartDef = New-ExcelChartDefinition -XRange Date -YRange Count -Title "User Logins" -ChartType Line -NoLegend -Width 1200 $Outline = [System.Drawing.Color]::FromArgb(255,120,0) $Import | Export-Excel -Path "$Output\Logs\UserLoggedIn.xlsx" -Append -WorksheetName "Line Chart" -AutoNameRange -ExcelChartDefinition $ChartDefinition

Thank you!

evild3ad avatar Aug 19 '23 05:08 evild3ad

Thank you for using the module.

Good question. I would google to see "changing chart outline color EPPlus" to see if there is a way. Then use -PassThru on the Export-Excel, get the object model and code to that.

dfinke avatar Aug 19 '23 14:08 dfinke