ascii_bar_charter
Version, currently 1.4.08 versions
github.com/drhuffman12/ascii_bar_charter
ASCII character-based bar chart generator
Nothing has been indexed for 1.4.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
ascii_bar_charter:
github: drhuffman12/ascii_bar_charter
version: ~> 1.4.0Then run:
shards installshard.yml
No shard.yml has been indexed for 1.4.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
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.0- Tagged
- Mar 27, 2021
- Commit
b4a4589d02de- Indexed
- not yet
Dependents
Repository
github.com/drhuffman12/ascii_bar_charter
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 30, 2026
- Synced
- Sep 30, 2026
- Versions
- 8