This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Showing values in chart #66
Comments
Basically, you would need to build Names with values inside. $userObjects = Get-ADUser -Filter *
$chart = $userObjects | Group-Object Department | Select-Object Name, @{Name = "Values"; Expression = { [math]::round(((($.Count) / $userObjects.Count) * 100), 2) } } | Where-Object { $.Values -GE 1 } | Sort-Object -Descending Values
Add-WordText -WordDocument $reportFile -HeadingType Heading3 -Text "Chart" -Supress $true
[array] $Names = foreach ($O in $Chart) {
"$($O.Name) ($($O.Values))"
}
Add-WordPieChart -WordDocument $reportFile -ChartName 'Chartk'-ChartLegendPosition Bottom -ChartLegendOverlay $false -Names $Names -Values $([array]$chart.Values) |
But is it possible to simplify that by adding more options to cmdlet. Like adding values to pie like: percent values or simple values or something? |
Yes, you can create PR to do it for you. |
I try to do it with calculated field but no results( to simplify my code). |
You just need to calculate the percentage yourself. My code won't do it for you. |
I know how to calculate it but dont know how to pass it into pie like in the 2 image |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to show values in chart legend or on the chart image. How to do this?
The text was updated successfully, but these errors were encountered: