Skip to content

andras-tim/tchart

Repository files navigation

tchart

Python Package Build Status Dependency Status Code Quality Test Coverage License

Minimal chart renderer for fixed size canvas for Python.

Installation

pip install tchart

Usage

  • simple way:

    from tchart import Tchart
    
    t = Tchart(height=10, width=80)
    
    data = [12.1, -2, 100]
    chart = t.render(data)
    
    print('\n'.join(chart))
  • extended way:

    from tchart import Tchart
    from tchart.renderers import BoxRenderer
    from tchart.decorators import AxisDecorator
    
    t = Tchart(height=10, width=80, renderer=BoxRenderer(), decorators=[AxisDecorator(), ])
    
    data = [12.1, -2, 100]
    chart = t.render(data)
    
    print('\n'.join(chart))

Examples

Please check the examples directory.

  • examples/show_all_renderers.py
    Renderers
  • examples/show_all_decorators.py
    Decorators
  • examples/show_stacked_decorators.py
    StackedDecorators

Bugs

Bugs or suggestions? Visit the issue tracker.