I am writing code that draws a simple line graph to the Console, and can use Unicode characters. I am looking for the best way to encode 45° angled lines into my graphs.
For instance, here's a 2x2 block of Unicode characters, representing a 45° angled line intersecting a vertical line:
│
│╲
In an ideal world, I'd like to find a set of Unicode characters which fits in the same 2x2 space and touches the edges in the same spots, but the diagonal line reaches all the way to the vertical one somehow.
The closest thing I've found is that you could replace the vertical line with ▕
, like this, but then the vertical bar won't touch the edges in the same spots, so it won't cleanly fit the rest of the graph.
▕
▕╲
Any other ideas?
Different fonts draw "one eighth block" differently, so you just need to choose the font that better suits your needs, e.g.:
- Hack font
- Segoe UI
- MS Gothic
Other characters, that may be come in handy:
▕
(Right one eighth block)▏
(Left one eighth block)╱
(Light diagonal upper right to lower left)╲
(Light diagonal upper left to lower right)╳
(Light diagonal cross)More drawing characters: https://en.wikipedia.org/wiki/Box-drawing_character
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With