TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: ASCII line chart with console, HTML and image outputs, written in PHP

74 pointsby noximoalmost 7 years ago

6 comments

protomikronalmost 7 years ago
Nice work, I love exploiting unicode characters to &quot;draw&quot; in terminal environments. You seem to use &#x27;╰&#x27;, &#x27;╮&#x27;, &#x27;╭&#x27; and &#x27;╯&#x27; to approximate non-straight lines, interesting idea, I haven&#x27;t seen this before.<p>Another approach is to use block characters, like U+259A or U+259E (see <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Block_Elements" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Block_Elements</a>), but unfortunately it is hard to do when you want to support colors as it doesn&#x27;t go well with intersections.<p>&#x2F;&#x2F;edit: HN does not like block elements, but your 21th century terminal will print them
评论 #17696581 未加载
tutfbhufalmost 7 years ago
I can also recommend:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kroitor&#x2F;asciichart" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kroitor&#x2F;asciichart</a> (JS, Py)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;guptarohit&#x2F;asciigraph" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;guptarohit&#x2F;asciigraph</a> (Go)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;madnight&#x2F;asciichart" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;madnight&#x2F;asciichart</a> (Haskell)
fluxsaucealmost 7 years ago
Nicely done! Glad to see the explicit shout-out to <a href="https:&#x2F;&#x2F;github.com&#x2F;kroitor&#x2F;asciichart" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kroitor&#x2F;asciichart</a><p>FYI, the original calls itself ASCII chart because it limits itself to ASCII - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;ASCII" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;ASCII</a><p>However, the curved shapes are from <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Code_page_866" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Code_page_866</a> which originated from the USSR and was used in DOS and OS&#x2F;2 to write Cyrillic script.<p>I honestly didn&#x27;t know until I searched for it; I was curious and didn&#x27;t recognize the characters.
评论 #17696327 未加载
评论 #17696607 未加载
gitgudalmost 7 years ago
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.
guptarohitalmost 7 years ago
Awesome! Good to see you added two new features, i.e. color and multiline. Check the one ported to the Go <a href="https:&#x2F;&#x2F;github.com&#x2F;guptarohit&#x2F;asciigraph" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;guptarohit&#x2F;asciigraph</a>
lixtraalmost 7 years ago
What’s your use case for this?
评论 #17696745 未加载
评论 #17696143 未加载