Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tchart

Fast terminal charts in Rust. A YouPlot alternative.

Install

cargo install --path tchart

# or with nix
nix run github:Uzaaft/tchart -- bar < data.tsv

Usage

echo -e "A\t10\nB\t20\nC\t15" | tchart bar
tchart line data.tsv
cat data.csv | tchart scatter -d comma -w 60 --height 20

# streaming mode
tail -f metrics.log | tchart line -p

Commands

  • bar - horizontal bar chart
  • line - line chart with braille
  • scatter / s - scatter plot
  • hist - histogram
  • density / d - 2D density heatmap
  • box - box-and-whisker plot
  • count / c - count values and plot as bar

Options

-d, --delimiter   t(ab), c(omma), s(pace), w(hitespace)
-H, --header      skip first row
-t, --title       chart title
-w, --width       plot width (default: 40)
    --height      plot height (default: 15)
    --color       enable/disable colors
-p, --progress    streaming mode

Histogram: -n, --bins (default: 10) Density: --xbins, --ybins (default: 10)

Config

~/.config/tchart/config.yaml or .tchartrc:

delimiter: tab
width: 60
height: 20
color: true

Library

use tchart_lib::{Barplot, BarEntry, BarplotConfig, Lineplot};

let entries = [
    BarEntry::new("A", 10.0),
    BarEntry::new("B", 20.0),
];
let barplot = Barplot::new(&entries, BarplotConfig::default());
println!("{}", barplot.render());

let mut lineplot = Lineplot::new(40, 10);
lineplot.plot_line(&[1.0, 5.0, 3.0, 8.0]);
println!("{}", lineplot.render());

License

MIT

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages