mkaz / termgraph

a python command-line tool which draws basic graphs in the terminal
MIT License
3.15k stars 165 forks source link

Three unnecessary blank lines #113

Open KonerDev opened 5 months ago

KonerDev commented 5 months ago

When printing this chart without categories, there are three blank lines above the actual chart. This doesn't look good and is simply unnecessary:

from termgraph.module import Data, BarChart, Args, Colors

data = Data([[10], [50], [80], [100]], ["Label 1", "Label 2", "Label 3", "Label 4"])
chart = BarChart(
    data,
    Args(
        colors=[Colors.Red],
        suffix="%",
    ),
)

chart.draw()
$ py test.py

Label 1: ▇▇▇▇▇ 10.00%
Label 2: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 50.00%
Label 3: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 80.00%
Label 4: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00%