Pode.Web
Pode.Web copied to clipboard
Pie chart height
Hi @Badgerati
I'm playing with some charts. Line and bar are working fine, but when I try to use Pie or Doughnut the height of the chart is way to high and doesn't fit on the page anymore. When I add a height parameter it's working fine for a line or bar chart, but not when using Pie or Doughnut. See the attached screenshots.
I'm using the following code as example:
`New-PodeWebCard -Name "Processes" -Content @( New-PodeWebChart -Name 'Processes' -Type Bar -Height "40%" -ScriptBlock {
Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10 | ConvertTo-PodeWebChartData -LabelProperty ProcessName -DatasetProperty CPU
}
)`
This is working fine, but when using: `New-PodeWebCard -Name "Processes" -Content @( New-PodeWebChart -Name 'Processes' -Type Pie -Height "40%" -ScriptBlock {
Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10 | ConvertTo-PodeWebChartData -LabelProperty ProcessName -DatasetProperty CPU
}
)`
Then the chart will not fit on the page.

Hmm, I can reproduce it as well. It looks like Charts.js is just ignoring the height value for Pie and Doughnut charts 🤔
I'll have to investigate and see what's going on.