asciigraph icon indicating copy to clipboard operation
asciigraph copied to clipboard

`-sc` must be specified for `-sl` to work

Open shuckster opened this issue 1 year ago • 1 comments

ie; -sc red,blue -sl x,y will work, but -sl x,y will result in:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/guptarohit/asciigraph.addLegends(0x140000efaa8, 0x140000dc000, 0x32, 0x9)
        /Users/mostly/go/pkg/mod/github.com/guptarohit/[email protected]/legend.go:31 +0x1d4
github.com/guptarohit/asciigraph.PlotMany({0x140000a04e0, 0x2, 0x102e4efb8?}, {0x14000098e18, 0xc, 0x102e2ecfe?})
        /Users/mostly/go/pkg/mod/github.com/guptarohit/[email protected]/asciigraph.go:261 +0xb84
main.main()
        /Users/mostly/go/pkg/mod/github.com/guptarohit/[email protected]/cmd/asciigraph/main.go:174 +0xabc

Regardless, I really appreciate the tool, thank you!

shuckster avatar Nov 02 '24 22:11 shuckster

@guptarohit Hello! I have a solution with this issue, use default color to solve the index out of range issue. Could I try it?

viiccwen avatar Jul 21 '25 02:07 viiccwen