Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical graph not rendering? #76

Open
ckcollab opened this issue Jan 22, 2021 · 0 comments
Open

Vertical graph not rendering? #76

ckcollab opened this issue Jan 22, 2021 · 0 comments

Comments

@ckcollab
Copy link

ckcollab commented Jan 22, 2021

First of all: thank you so much for this neat library, appreciate all the work that has gone into making this :)

I am trying to make a graph from within another Python script, and here's a working version:

In [1]: from termgraph.termgraph import stacked_graph, AVAILABLE_COLORS, normalize, chart
   ...: 
   ...: labels = ["size 1", "size 10", "size 100"]
   ...: data = [
   ...:     [1, 1, 10],
   ...:     [1, 10, 100],
   ...:     [1, 100, 120],
   ...: ]
   ...: colors = [
   ...:     AVAILABLE_COLORS.get("green"),
   ...:     AVAILABLE_COLORS.get("yellow"),
   ...:     AVAILABLE_COLORS.get("red"),
   ...: ]
   ...: args = {
   ...:     "no_labels": False,
   ...:     "format": "{:<5.2f}",
   ...:     "suffix": "",
   ...:     "stacked": False,
   ...:     "histogram": False,
   ...:     "width": 50,
   ...:     "different_scale": False,
   ...:     "no_values": False,
   ...:     "vertical": False,
   ...: }
   ...: chart(colors, data, args, labels)
size 1  : ▏ 1.00 
          ▏ 1.00 
          ▇▇▇▇ 10.00
size 10 : ▏ 1.00 
          ▇▇▇▇ 10.00
          ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
size 100: ▏ 1.00 
          ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
          ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 120.00

However, if I change args["vertical"] to True, I get ...

In [2]: args["vertical"] = True
   ...: chart(colors, data, args, labels)
   ...: 

(no output)

Maybe I am switching up args weirdly or something, looked through the Readme and I may have missed any misc. requirements for vertical. Appreciate any help, will keep digging though!

EDIT

Of course as soon as I post this I find...

https://github.com/mkaz/termgraph/blob/main/termgraph/termgraph.py#L465

Adding "different_scale": True, made something print, but it seems rather broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant