From 54d76fa24a476ae391b8e0c8708c90ce48f521ad Mon Sep 17 00:00:00 2001 From: bennyguk Date: Wed, 27 Apr 2022 16:16:25 +0100 Subject: [PATCH] Update Show-Graph.ps1 As discussed in issue 25, these changes will enable the lowest value in the dataset to be rendered properly. --- src/Show-Graph.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Show-Graph.ps1 b/src/Show-Graph.ps1 index 5948584..600b958 100644 --- a/src/Show-Graph.ps1 +++ b/src/Show-Graph.ps1 @@ -145,7 +145,7 @@ Function Show-Graph { [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--){ + For($i=$NumOfRows;$i -ge 0;$i--){ $Row = '' For($j=0;$j -lt $NumOfDatapoints;$j++){ $Cell = $Array[$i,$j] @@ -218,7 +218,7 @@ Function Show-Graph { elseif($RangePercent-le 80 -and $RangePercent -gt 40) { Write-Graph $YAxisLabelAlphabet $YAxisLabel $Row 'Yellow' 'DarkYellow' } - elseif($RangePercent -le 40 -and $RangePercent -ge 1) { + elseif($RangePercent -le 40 -and $RangePercent -ge 0) { Write-Graph $YAxisLabelAlphabet $YAxisLabel $Row 'Green' 'DarkYellow' } else {