Expand description
Compact bar charts in the terminal.
ยงExamples
labeled comparison
use chart_relative::{params::*, Chart};
let chart = Chart::new(
&[
0, 22, 2, 9, 223, 34, 33, 66, 76, 122, 199, 33, 12, 89, 1222, 100,
],
Some(ChartComparison {
data: &[
14, 20, 1, 8, 223, 12, 56, 79, 69, 100, 1122, 33, 45, 9, 9000, 78,
],
}),
ChartOptions {
height: 16,
view: ViewPreference::Bottom,
display: DisplayMode::Portrait {
labels: &[
"first", "second", "third", "fourth", "fifth", "sixth", "seventh",
"eighth", "nineth", "tenth", "eleventh", "twelfth", "thirteenth",
"fourteenth", "fifteenth", "sixteenth",
],
},
},
);
println!("{chart}");output (with color)
122โ ๐ข๐ข โ ๐ข๐ข ๐ข๐ข
โ ๐ข๐ข โ ๐ข๐ข ๐ข๐ข
โ ๐ข๐ข โ ๐ข๐ข ๐ข๐ข
โ ๐ข๐ข โโ ๐ข๐ข ๐ข๐ข โ
โ ๐ข๐ข โโ ๐ข๐ข โ
๐ข๐ข โ
โ ๐ข๐ข โ โโ ๐ข๐ข โ ๐ข๐ข โโ
โ ๐ข๐ข โ โ โโ ๐ข๐ข โ ๐ข๐ข โโ
โ ๐ข๐ข โ
โ โโ โโ ๐ข๐ข โ ๐ข๐ข โโ
โ ๐ข๐ข โ โโ โโ โโ ๐ข๐ข โ ๐ข๐ข โโ
โ ๐ข๐ข โ โโ โโ โโ ๐ข๐ข โ ๐ข๐ข โโ
โ ๐ข๐ข โ โโ โโ โโ ๐ข๐ข โ โ ๐ข๐ข โโ
โ ๐ข๐ข โ โโ โโ โโ โโ ๐ข๐ข โโ โ โ ๐ข๐ข โโ
โ ๐ข๐ข โ โโ โโ โโ โโ ๐ข๐ข โโ โ โ ๐ข๐ข โโ
โ โโ ๐ข๐ข โ โโ โโ โโ โโ ๐ข๐ข โโ โ โ ๐ข๐ข โโ
โ โ โโ โ ๐ข๐ข โโ โโ โโ โโ โโ ๐ข๐ข โโ โโ โโ ๐ข๐ข โโ
1โโจฏโ โโ โโ โโ ๐ข๐ข โโ โโ โโ โโ โโ ๐ข๐ข โโ โโ โโ ๐ข๐ข โโ
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0: first 6: seventh 12: thirteenth
1: second 7: eighth 13: fourteenth
2: third 8: nineth 14: fifteenth
3: fourth 9: tenth 15: sixteenth
4: fifth 10: eleventh
5: sixth 11: twelfthModulesยง
- params
- Parameters for creating a
Chart.
Structsยง
- Chart
- Display a slice of up to 100
u32values.