Skip to content

Progressive Graph on Reading Each Data #89

@monsieurDuke

Description

@monsieurDuke

Hey there. So I was wondering if there are some way to make the graph become progressive, since it reads new data on the new next line in a file. Here is my snippet on the Bash script.

#!/bin/bash
while IFS= read -r each_stat; do
  echo "$each_stat" > "log/each_result.csv" & wait
  termgraph "log/each_result.csv" --color {cyan,red,yellow,green}; sleep 0.01s
  printf "\033[6A ";
done < "log/result.csv"

First I passed each line of the file to a temp file, so termgraph can read only one data at a time. then I return the cursor 6 line before and continue to read the next data. But its not updating the bar quite what I wanted to, which become overlapped with the previous bar. Are there any solution to overwrite the previous one, without clearing the screen ?

Thanks for the opportunity, really cool stuff !

image
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions