Skip to main content

A tool to draw ascii line chart in terminal

Project description

TermChart

Draw ascii line charts in terminal.

termchart_screenshot

Install

pip3 install termchart

USage

Create a Python file :

import termchart

graph = termchart.Graph([1,2,3,2,5,1,-1,-5,-3])
graph.draw()

You can change the plot (default is +):

graph.setDot('|')

Change the width and height (default cols is 160x50)

graph.setCols(200)
graph.setRows(40)

Add values whenever you need it with addData(<Float>). Here is a full example for a live graph with random values :

import termchart
import time
import os
from random import randint

graph = termchart.Graph([])
while True:
    rand = randint(0, 9)
    graph.addData(rand)
    graph.draw()
    time.sleep(1)
    os.system('cls' if os.name == 'nt' else 'clear')

Donate

https://en.jeffprod.com/donate/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for termchart, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size termchart-0.0.4-py2.py3-none-any.whl (2.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size termchart-0.0.4.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page