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

fix: Es wurde kein Positionsparameter gefunden, der das Argument "│" … #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Show-Graph.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ Function Show-Graph {
$BottomBoundaryLength = $XAxis.Length + 2

# draw top boundary
[string]::Concat($TopLeft," ",$GraphTitle," ",$([string]$TopEdge * $TopBoundaryLength),$TopRight)
[String]::Concat($VerticalEdge,$(" "*$($XAxis.length+2)),$VerticalEdge) # extra line to add space between top-boundary and the graph
Write-Host ([string]::Concat($TopLeft," ",$GraphTitle," ",$([string]$TopEdge * $TopBoundaryLength),$TopRight))
Write-Host ([String]::Concat($VerticalEdge,$(" "*$($XAxis.length+2)),$VerticalEdge)) # extra line to add space between top-boundary and the graph

# draw the graph
For($i=$NumOfRows;$i -gt 0;$i--){
Expand Down Expand Up @@ -231,20 +231,20 @@ Function Show-Graph {

# draw bottom boundary
$XAxisLabel +=" "*($XAxis.Length-$XAxisLabel.Length) # to match x-axis label length with x-axis length
[String]::Concat($VerticalEdge,$XAxis," ",$VerticalEdge) # Prints X-Axis horizontal line
[string]::Concat($VerticalEdge,$XAxisLabel," ",$VerticalEdge) # Prints X-Axis step labels
Write-Host([String]::Concat($VerticalEdge,$XAxis," ",$VerticalEdge)) # Prints X-Axis horizontal line
Write-Host([string]::Concat($VerticalEdge,$XAxisLabel," ",$VerticalEdge)) # Prints X-Axis step labels


if(![String]::IsNullOrWhiteSpace($XAxisTitle)){
# Position the x-axis label at the center of the axis
$XAxisTitle = " "*$LengthOfMaxYAxisLabel + (CenterAlignString $XAxisTitle $XAxis.Length)
Write-Host -Object $VerticalEdge -NoNewline
Write-Host -Object $XAxisTitle -ForegroundColor DarkYellow -NoNewline # Prints XAxisTitle
Write-Host -Object $(" "*$(($LengthOfMaxYAxisLabel + $XAxis.length) - $XAxisTitle.Length - 2)) $VerticalEdge
Write-Host -Object ($(" "*$(($LengthOfMaxYAxisLabel + $XAxis.length) - $XAxisTitle.Length - 2)) + " " + $VerticalEdge)
}

# bottom boundary
[string]::Concat($BottomLeft,$([string]$BottomEdge * $BottomBoundaryLength),$BottomRight)
Write-Host([string]::Concat($BottomLeft,$([string]$BottomEdge * $BottomBoundaryLength),$BottomRight))

}

Expand Down
2 changes: 1 addition & 1 deletion src/UtilityFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Function Write-Graph($YAxisLabelAlphabet, $YAxisLabel, $Row, $RowColor, $LabelCo
Write-Host -Object "$($YAxisLabel.tostring().PadLeft($LengthOfMaxYAxisLabel+2) + [Char]9508)" -NoNewline
##Write-Host "$YAxisLabel|" -NoNewline
Write-Host -Object $Row -ForegroundColor $RowColor -NoNewline
Write-Host -Object " " $([char]9474)
Write-Host -Object (" " + $([char]9474))
}