I’m trying to get a line chart to have a fixed height, but auto width.
No matter how I try height always scales with width - when put inside a constraining component like a Card or Div, the chart simply scales outside whats visible.
Can this be achieved?
I found no solution that worked with my way of thinking.
Instead of looking for a solution to specify a set height, I found a solution to change the aspect ratio,
Responsive Charts | Chart.js (chartjs.org)
$Options = @{
Type = 'line'
Data = $PingReportCombinedScoreList
Dataset = $DataSet
LabelProperty = "Date"
Options = @{
aspectRatio = 3 # <------------- heigher number = smaller
scales = @{
yAxes =
@{
display = $true
beginAtZero = $false
}
}
}
}
New-UDChartJS @Options