Skip to content

Set chart location to a dedicated worksheet #1490

Answered by geoced
geoced asked this question in Q&A
Discussion options

You must be logged in to vote

Found it !

You have to create an ExcelChartSheet with this code:

$chartSheet = $xl.Workbook.Worksheets.AddChart('SheetTitle', [OfficeOpenXml.Drawing.Chart.eChartType]::Line)
$chart = $chartSheet.Drawings[0]
$chart.Title.Text = 'Chart Title'
$series = $chart.Series.Add($yRange, $xRange)

Would be nice if this option was offered by ImportExcel, e.g. as a [switch] parameter of Add-ExcelChart !

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dfinke
Comment options

Answer selected by geoced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants