ascii_graph Package

ascii_graph Package

class ascii_graph.__init__.Pyasciigraph(line_length=79, min_graph_length=50, separator_length=2)

Constructor of Pyasciigraph

  • line_length (int) – the max number of char on a line if any line cannot be shorter, it will go over this limit
  • min_graph_length (int) – the min number of char used by the graph
  • separator_length (int) – the length of field separator
graph(label, data, sort=0, with_value=True)

function generating the graph

  • label (string) – the label of the graph
  • data (iterable) – the data (list of tuple (info, value)) info must be “castable” to a unicode string value must be an int or a float
  • sort (int) – flag sorted 0: not sorted (same order as given) (default) 1: increasing order 2: decreasing order
  • with_value (boolean) – flag printing value True: print the numeric value (default) False: don’t print the numeric value
Return type:

a list of strings (each lines)