Graphical icon indicating copy to clipboard operation
Graphical copied to clipboard

Box character misplaced if graph doesn't end on an interval step

Open felixfbecker opened this issue 7 years ago • 1 comments

E.g. if the X axis step is the default 10, and the amount of data points is not dividable by 10, the last | box boundary character will be misplaced:

Datapoints: 67, 68, 33, 62, 38, 68, 55
┌ go_goroutines ┐
│               │
│   70┤██ █ █▐  │
│   60┤ ▐▐▐▐▐█  │
│   50┤ ▐▐▐▐ ▐  │
│   40┤  █ █ ▐  │
│     └───────  │
│        │
└───────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68
┌ go_goroutines ─┐
│                │
│   70┤██ █ █ █  │
│   60┤ ▐▐▐▐▐█▐  │
│   50┤ ▐▐▐▐  ▐  │
│   40┤  █ █  ▐  │
│     └────────  │
│        │
└────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60
┌ go_goroutines ──┐
│                 │
│   70┤██ █ █ █▐  │
│   60┤ ▐▐▐▐▐█▐█  │
│   50┤ ▐▐▐▐   ▐  │
│   40┤  █ █   ▐  │
│     └─────────  │
│        │
└─────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60
┌ go_goroutines ───┐
│                  │
│   70┤██ █ █ █ ▐  │
│   60┤ ▐▐▐▐▐█▐██  │
│   50┤ ▐▐▐▐    ▐  │
│   40┤  █ █    ▐  │
│     └─────────┬  │
│              10  │
└──────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72
┌ go_goroutines ────┐
│                   │
│   80┤          █  │
│   70┤██ █ █ █ ▐▐  │
│   60┤ ▐▐▐▐▐█▐██▐  │
│   50┤ ▐▐▐▐     ▐  │
│   40┤  █ █     ▐  │
│     └─────────┬─  │
│              10  │
└───────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54
┌ go_goroutines ─────┐
│                    │
│   80┤          █▐  │
│   70┤██ █ █ █ ▐▐▐  │
│   60┤ ▐▐▐▐▐█▐██ █  │
│   50┤ ▐▐▐▐      ▐  │
│   40┤  █ █      ▐  │
│     └─────────┬──  │
│              10  │
└────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44
┌ go_goroutines ──────┐
│                     │
│   80┤          █ ▐  │
│   70┤██ █ █ █ ▐▐ ▐  │
│   60┤ ▐▐▐▐▐█▐██ █   │
│   50┤ ▐▐▐▐      ▐█  │
│   40┤  █ █       ▐  │
│     └─────────┬───  │
│              10  │
└─────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73
┌ go_goroutines ───────┐
│                      │
│   80┤          █  █  │
│   70┤██ █ █ █ ▐▐ ▐▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐▐  │
│   50┤ ▐▐▐▐      ▐█▐  │
│   40┤  █ █        ▐  │
│     └─────────┬────  │
│              10  │
└──────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62
┌ go_goroutines ────────┐
│                       │
│   80┤          █  █▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█  │
│   60┤ ▐▐▐▐▐█▐██ █▐ ▐  │
│   50┤ ▐▐▐▐      ▐█ ▐  │
│   40┤  █ █         ▐  │
│     └─────────┬─────  │
│              10  │
└───────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75
┌ go_goroutines ─────────┐
│                        │
│   80┤          █  █ █  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐  ▐  │
│   50┤ ▐▐▐▐      ▐█  ▐  │
│   40┤  █ █          ▐  │
│     └─────────┬──────  │
│              10  │
└────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61
┌ go_goroutines ──────────┐
│                         │
│   80┤          █  █ █▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐  │
│   50┤ ▐▐▐▐      ▐█   ▐  │
│   40┤  █ █           ▐  │
│     └─────────┬───────  │
│              10  │
└─────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53
┌ go_goroutines ───────────┐
│                          │
│   80┤          █  █ █ ▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█  │
│   50┤ ▐▐▐▐      ▐█    ▐  │
│   40┤  █ █            ▐  │
│     └─────────┬────────  │
│              10  │
└──────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53, 34
┌ go_goroutines ────────────┐
│                           │
│   80┤          █  █ █  ▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█ ▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█   │
│   50┤ ▐▐▐▐      ▐█    ▐   │
│   40┤  █ █             █  │
│     └─────────┬─────────  │
│              10  │
└───────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53, 34, 56
┌ go_goroutines ─────────────┐
│                            │
│   80┤          █  █ █   ▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█  ▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█ █  │
│   50┤ ▐▐▐▐      ▐█    ▐▐▐  │
│   40┤  █ █             █▐  │
│     └─────────┬─────────┬  │
│              10        20  │
└────────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53, 34, 56, 74
┌ go_goroutines ──────────────┐
│                             │
│   80┤          █  █ █    █  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█  ▐▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█ █▐  │
│   50┤ ▐▐▐▐      ▐█    ▐▐ ▐  │
│   40┤  █ █             █ ▐  │
│     └─────────┬─────────┬─  │
│              10        20  │
└─────────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53, 34, 56, 74, 41
┌ go_goroutines ───────────────┐
│                              │
│   80┤          █  █ █    █▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█  ▐▐▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█ █▐   │
│   50┤ ▐▐▐▐      ▐█    ▐▐  █  │
│   40┤  █ █             █  ▐  │
│     └─────────┬─────────┬──  │
│              10        20  │
└──────────────────────────────┘
Datapoints: 67, 68, 33, 62, 38, 68, 55, 68, 60, 60, 72, 54, 44, 73, 62, 75, 61, 53, 34, 56, 74, 41, 33
┌ go_goroutines ────────────────┐
│                               │
│   80┤          █  █ █    █ ▐  │
│   70┤██ █ █ █ ▐▐ ▐▐█▐█  ▐▐ ▐  │
│   60┤ ▐▐▐▐▐█▐██ █▐   ▐█ █▐    │
│   50┤ ▐▐▐▐      ▐█    ▐▐  █   │
│   40┤  █ █             █  ▐█  │
│     └─────────┬─────────┬───  │
│              10        20  │
└───────────────────────────────┘

2018-08-09 18 54 10

felixfbecker avatar Aug 09 '18 16:08 felixfbecker

This can be fixed by changing line #243 in Show-Graph.ps1.

Write-Host $(" "*$($XAxis.length - $XAxisTitle.Length + 1)) $VerticalEdge

replaced '-2' with '+1', removed LengthOfMaxYAxisLabel as this will dynamically change.

MartinSky123 avatar Feb 10 '22 19:02 MartinSky123