I’m writing a command line (non-graphical) Linux program in C++, and in some places I need it to draw a chart or plot a function right into the terminal.
Looking at some programs like ntsysv, mc, alsa etc., I believe it’s possible but I was wondering how.
Seconding the ncurses recommendation, there also exists a library called libcaca, a graphics library that outputs ASCII text instead of pixels. If you want to create this graphs with other software and then push their output to the terminal you could consider using libcaca with ncurses.