mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-16 08:13:54 +00:00
Ensure Datalabel is not null before referencing it.
This commit is contained in:
@@ -350,8 +350,11 @@ function Export-Excel {
|
|||||||
$chart.Legend.Remove()
|
$chart.Legend.Remove()
|
||||||
}
|
}
|
||||||
#$chart.Datalabel.ShowLegendKey = $true
|
#$chart.Datalabel.ShowLegendKey = $true
|
||||||
$chart.Datalabel.ShowCategory = $chartDef.ShowCategory
|
|
||||||
$chart.Datalabel.ShowPercent = $chartDef.ShowPercent
|
if ($chart.Datalabel -ne $null) {
|
||||||
|
$chart.Datalabel.ShowCategory = $chartDef.ShowCategory
|
||||||
|
$chart.Datalabel.ShowPercent = $chartDef.ShowPercent
|
||||||
|
}
|
||||||
|
|
||||||
$chart.SetPosition($chartDef.Row, $chartDef.RowOffsetPixels,$chartDef.Column, $chartDef.ColumnOffsetPixels)
|
$chart.SetPosition($chartDef.Row, $chartDef.RowOffsetPixels,$chartDef.Column, $chartDef.ColumnOffsetPixels)
|
||||||
$chart.SetSize($chartDef.Width, $chartDef.Height)
|
$chart.SetSize($chartDef.Width, $chartDef.Height)
|
||||||
|
|||||||
Reference in New Issue
Block a user