ascii_bar_charter
Version, currently 1.4.18 versions
github.com/drhuffman12/ascii_bar_charter
ASCII character-based bar chart generator
1 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
ascii_bar_charter:
github: drhuffman12/ascii_bar_charter
version: ~> 1.4.1Then run:
shards installshard.yml
- Crystal
>= 1.0.0- License
- MIT
- Author
- Daniel Huffman
- Target
abcfrom src/abc.cr
Dependencies
This version declares no dependencies.
README
ascii_bar_charter
This is a ASCII character-based bar char generator, with optional value prefix (of given precision) and optional colorization (red/green gradations).
Installation
-
Add the dependency to your
shard.yml:dependencies: ascii_bar_charter: github: drhuffman12/ascii_bar_charter branch: master -
Run
shards install
Usage
require "ascii_bar_charter"
Generate a B/W barchart of values with associated value as a prefix:
min = 0.0
max = 1.0
precision = 2.to_i8
in_bw = true
data = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
prefixed = true
reversed = false
charter = AsciiBarCharter.new(min, max, precision, in_bw, reversed)
plot = charter.plot(data, prefixed)
puts plot
This will (when in bw only) look like:
0.0_0.1▁0.2▂0.3▃0.4▄0.5▅0.6▆0.7▇0.8█0.9▉
_▁▂▃▄▅▆▇█▉
And, using custom colors/bars could look like:
.0.0'0.1'0.2░0.3░0.4▒0.5▒0.6▒0.7▓0.8▓0.9█
.''░░▒▒▒▓▓█
For other examples, see the tests.
Testing
(Optionally,) open a docker-compose terminal:
docker-compose run app bash
Then run tests:
crystal spec
It should look like:

Contributing
- Fork it (https://github.com/your-github-user/ascii_bar_charter/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Daniel Huffman - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.4.1- Tagged
- Mar 27, 2021
- Commit
ec01d126bfd2- Crystal
>= 1.0.0- Indexed
- yes
Dependents
Repository
github.com/drhuffman12/ascii_bar_charter
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 30, 2026
- Synced
- Sep 30, 2026
- Versions
- 8