guptarohit / asciigraph

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
https://pkg.go.dev/github.com/guptarohit/asciigraph
BSD 3-Clause "New" or "Revised" License
2.68k stars 102 forks source link

Axis cross (┼) is in the wrong place at some scales #11

Closed xordspar0 closed 5 years ago

xordspar0 commented 5 years ago

For some inputs and at certain scales, the axis cross doesn't line up with the plotted data:

screen shot 2019-02-02 at 2 37 29 pm

I can reproduce this with the following inputs:

echo '3084
3056
3047
3043
3041
3043
3043
3036
3033
3042
3042
3040
3032
3039
3018
2925
2926
2925
2923
2922
2924
2920
2910
2906
2907
2908
2908
2908
2908
2917
2914
2911
2914
2909
2913
2910
2914
2915
2894
2915
2913
2915
2907
2908
2916
2911
2910
2912
2903
2914
2911
2905
2903
2901
2910
2899
2901
2901
2902
2909
2904
2908
2893
2901
2903
2903
2908
2910
2900
2898
2903
2895' | asciigraph -h 24
guptarohit commented 5 years ago

Hi @xordspar0, I'm not getting the same output for the input you gave. The axis cross seems to be in right place.

screenshot from 2019-02-03 12-38-59

Let me know if you face the same issue with other data points.

Please make sure you have the latest binary. go get -u github.com/guptarohit/asciigraph & go install github.com/guptarohit/asciigraph/cmd/asciigraph

xordspar0 commented 5 years ago

Ah, my mistake. I forgot to go install the latest binary.