beem.asciichart

class beem.asciichart.AsciiChart(height=None, width=None, offset=3, placeholder='{:8.2f} ', charset='utf8')

Bases: object

Can be used to plot price and trade history

Parameters:
  • height (int) – Height of the plot
  • width (int) – Width of the plot
  • offset (int) – Offset between tick strings and y-axis (default is 3)
  • placeholder (str) – Defines how the numbers on the y-axes are formatted (default is ‘{:8.2f}’)
  • charset (str) – sets the charset for plotting, uft8 or ascii (default: utf8)
adapt_on_series(series)

Calculates the minimum, maximum and length from the given list

Parameters:series (list) – time series to plot
from beem.asciichart import AsciiChart
chart = AsciiChart()
series = [1, 2, 3, 7, 2, -4, -2]
chart.adapt_on_series(series)
chart.new_chart()
chart.add_axis()
chart.add_curve(series)
print(str(chart))
add_axis()

Adds a y-axis to the canvas

from beem.asciichart import AsciiChart
chart = AsciiChart()
series = [1, 2, 3, 7, 2, -4, -2]
chart.adapt_on_series(series)
chart.new_chart()
chart.add_axis()
chart.add_curve(series)
print(str(chart))
add_curve(series)

Add a curve to the canvas

Parameters:series (list) – List width float data points
from beem.asciichart import AsciiChart
chart = AsciiChart()
series = [1, 2, 3, 7, 2, -4, -2]
chart.adapt_on_series(series)
chart.new_chart()
chart.add_axis()
chart.add_curve(series)
print(str(chart))
clear_data()

Clears all data

new_chart(minimum=None, maximum=None, n=None)

Clears the canvas

from beem.asciichart import AsciiChart
chart = AsciiChart()
series = [1, 2, 3, 7, 2, -4, -2]
chart.adapt_on_series(series)
chart.new_chart()
chart.add_axis()
chart.add_curve(series)
print(str(chart))
plot(series, return_str=False)

All in one function for plotting

from beem.asciichart import AsciiChart
chart = AsciiChart()
series = [1, 2, 3, 7, 2, -4, -2]
chart.plot(series)
set_parameter(height=None, offset=None, placeholder=None)

Can be used to change parameter