spark icon indicating copy to clipboard operation
spark copied to clipboard

the last bar is always one number wide

Open naknak- opened this issue 6 years ago • 0 comments

Data 0 1 19 20 should print ▁▁██ but prints ▁▁▇█

The problem is the number 7 in your character index calculation. A working formula for the index is int( 8 * (n-min)/(max-min) ) with n==max special-cased to give 7.

See also https://rosettacode.org/wiki/Talk:Sparkline_in_unicode#Most_of_these_are_buggy

naknak- avatar Feb 24 '19 10:02 naknak-