Closed Kettoch closed 3 years ago
$Bounces = @(
[PSCustomObject] @{ BounceTypeName = 'Area1'; Total = 5 }
[PSCustomObject] @{ BounceTypeName = 'Area2'; Total = 13 }
[PSCustomObject] @{ BounceTypeName = 'Area3'; Total = 18 }
[PSCustomObject] @{ BounceTypeName = 'Area4'; Total = 1 }
)
Dashboard -Name 'Bounce Chart' -FilePath C:\Scripts\DashboardChartsBar00.html {
TabOptions -slimtabs
Tab -Name 'Bounce Chart by Type' {
Panel {
Chart {
ChartTheme -Palette palette6
ChartLegend -FontSize 14 -FontFamily 'Arial'
foreach ($Bounce in $Bounces) {
ChartPie -Name $Bounce.BounceTypeName -Value $Bounce.Total
}
}
}
Section -Invisible {
Table -DataTable $Bounces -HideFooter {
Table -title 'Email Address'
TableHeader -names 'EmailAddress' -alignment Left
TableHeader -names 'Bounce Type','Date' -alignment Center
TableContent -ColumnIndex 2,3 -alignment center
}
}
}
} -Show
That's what I get
Seems to work?
I have the following code that receives a PSObject with three fields. What I get is a pie chart that obeys colors either with the theme or directly assigned on the legend. But i get no labels on the legend on the right.
I have tried adding -names either by $Bounces.BounceTypeName or by @('Hard Bounce','Soft Bounce') or not even including it.
I am not sure what i am missing as I get the color dots of the legend and no text. Nor can I get labels on the pie other than %.