Chart option for y-axis bounds?


#1

Is there a way to set fixed numbers in charts? For instance, I have a counter which is showing two numbers beside eachtoher but it’s not showing the floor - so instead of 0 to 32, it’s showing 14-32:
image

Code is here:

New-UDChart -Title "Webserver Memory Usage" -Type Bar -RefreshInterval 5 -Endpoint {
            $TotalMem = Get-WmiObject CCM_LogicalMemoryConfiguration | select @{Name="GB";Expression={$_.TotalPhysicalMemory/1mb}}
            $TotalMem = $TotalMem | Select -ExpandProperty GB
            $AvailMem = Get-WmiObject CCM_LogicalMemoryConfiguration | select @{Name="GB";Expression={$_.AvailableVirtualMemory/1mb}}
            $AvailMem = $AvailMem | Select -ExpandProperty GB
            $UsedMem = $TotalMem - $AvailMem
            [PSCustomObject]@{ 
                Name = "System Memory"
                TotalMemory = $TotalMem;
                UsedMemory = $UsedMem} | Out-UDChartData -LabelProperty "Name" -Dataset @(
                New-UdChartDataset -DataProperty "TotalMemory" -Label "TotalMemory" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23"
                New-UdChartDataset -DataProperty "UsedMemory" -Label "UsedMemory" -BackgroundColor "#8014558C" -HoverBackgroundColor "#8014558C"
            )
        }

#2

You can set the yAxis to always be 0: New-UDChart - Set the yAxes to start at zero