13 comments

[ 0.26 ms ] story [ 43.2 ms ] thread
Cool little project, I would put the gif of the graph at the beginning of the Readme before the advanced example. This shows off the application a bit earlier.
Nice work, I love exploiting unicode characters to "draw" in terminal environments. You seem to use '╰', '╮', '╭' and '╯' to approximate non-straight lines, interesting idea, I haven't seen this before.

Another approach is to use block characters, like U+259A or U+259E (see https://en.wikipedia.org/wiki/Block_Elements), but unfortunately it is hard to do when you want to support colors as it doesn't go well with intersections.

//edit: HN does not like block elements, but your 21th century terminal will print them

Nicely done! Glad to see the explicit shout-out to https://github.com/kroitor/asciichart

FYI, the original calls itself ASCII chart because it limits itself to ASCII - https://en.wikipedia.org/wiki/ASCII

However, the curved shapes are from https://en.wikipedia.org/wiki/Code_page_866 which originated from the USSR and was used in DOS and OS/2 to write Cyrillic script.

I honestly didn't know until I searched for it; I was curious and didn't recognize the characters.

> curved shapes are from https://en.wikipedia.org/wiki/Code_page_866

No? Even this very Wikipedia article says CP866 inherited the box-drawing characters from CP437 (and I bet that wasn't the first character set that had them).

Thanks.

I'm using the same characters that the original uses. Pretty much ctrl+c ctrl+v them into my code :)

I know your problem. You have too much free time;
What’s your use case for this?
I'm trying to make a trading bot but shifting through over a milion of historical prices tends to be a bit uncomfortable when they are outputted in a simple table.

So i looked for some chart that could help me visualize it but found none written in php so I wrote one myself.