mum4k / termdash

Terminal based dashboard.
Apache License 2.0
2.71k stars 135 forks source link

Widget: Line chart #7

Closed mum4k closed 6 years ago

mum4k commented 6 years ago

Implement a line chart widget.

Similar to: https://github.com/gizak/termui/raw/master/_example/linechart.png And: https://github.com/yaronn/blessed-contrib/raw/master/docs/images/line.gif

Also look at: https://github.com/cjbassi/termui and the use of: https://github.com/exrook/drawille-go

mum4k commented 6 years ago

What we need:

  1. The draw.Text() function needs to support vertically placed text to allow for labels on axes.
  2. Need a draw.Line() function that draws horizontal and vertical lines and uses correct corner characters where the lines meet.
  3. Need a draw.BrailleLine() function that draws lines using the Braille unicode characters (http://www.alanwood.net/unicode/braille_patterns.html).

Interesting features for the LineChart:

  1. Labels on the axes.
  2. Support both positive and negative values.
  3. Value labels, custom or derived from the values. The labels must be auto positioned based on the available horizontal and vertical space.
  4. Support for multiple values in the same chart (multiple lines).
  5. Support for labels for the displayed lines matching the line color as in (https://github.com/yaronn/blessed-contrib/raw/master/docs/images/line.gif).
mum4k commented 6 years ago

Converted to project.