Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pie chart height #368

Closed
breento opened this issue Oct 30, 2022 · 1 comment · Fixed by #589
Closed

Pie chart height #368

breento opened this issue Oct 30, 2022 · 1 comment · Fixed by #589
Assignees
Labels
bug 🐛 Something isn't working
Milestone

Comments

@breento
Copy link

breento commented Oct 30, 2022

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.
Bar
Pie

@Badgerati
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants