Bar Chart Bar width And Y Axis Label

Hello,

For the life of me, my brain’s not churning properly. Maybe it’s the Christmas season and I am already in vacation mode (2 weeks!!!). Anyway, does anybody know how to put a label on the Y axis of a bar chart? aaannnd, resize the bar width to be the same as the bar width of the other charts. I have multiple charts that shows the how long a certain maintenance schedule was over a period of time. The Y axis shows how long in minutes and the X axis are the dates the schedule ran. I need to put “minutes” on the Y axis and resize the bar for schedules that only ran a couple of times (see attached image). Thanks and Merry Christmas!!!

Here’s the portion of my script that generates the chart

New-UDPage -Name “Phase 1 Schedule Metrics” -Content{

New-UDRow -Endpoint{

    New-UDColumn -Size 2

    New-UDColumn -Size 8 -Content{

        foreach ($Item in $ResultsP1){

            New-UDChart -Type Bar -Height $MapHeight -Width $MapWidth -Options $MapOptions -Endpoint {

                $item | Out-UDChartData -DataProperty Diff -LabelProperty Start -Dataset @(

                        New-UDChartDataset -Label $item.job -DataProperty Diff -BackgroundColor $BGColor -HoverBackgroundColor $HoverBGColor

                )

            }

        }

    }

    New-UDColumn -Size 2

}

}

Just to clarify, I want to put the word “minutes” on the Y axis as a label and not in the form of - 0 min, 20 min, 40 min, etc. Thanks again.

New-UDChart -Type Bar -Height $MapHeight -Width $MapWidth -Options $MapOptions -Endpoint {
	$item | Out-UDChartData -DataProperty Diff -LabelProperty Start -Dataset @(
		New-UDChartDataset -Label $item.job -DataProperty Diff -BackgroundColor $BGColor -HoverBackgroundColor $HoverBGColor
	)
} -Options @{
	scales = @{
		yAxes = @(
			@{
				scaleLabel =@{
					display = $true
					labelString = "Y-axes label"
				}
			}
		)
	}
}

gav

1 Like