Skip to content

Commit

Permalink
feat(barchart): allow to render charts smaller than 3 lines
Browse files Browse the repository at this point in the history
Add an internal structure `LabelInfo`, which stores the reserved height
for the labels (0, 1 or 2) and also the state of the labels,
whether they will be shown or not.

Add internal property to the Bar `transformed_value`, which is used only
for in the vertical charts. This value is needed in 2 reasons:
1. to draw the vertical bar
2. to draw the bar value or text_value. If the transformed_value is below
   8 and the bar_width is 1, then the value will not be printed

transformed_value is line height multiplied by 8.
(8 is the number of element of symbols::bar::Set struct)

fixes #513

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
  • Loading branch information
karthago1 committed Sep 23, 2023
1 parent d67fa2c commit 9f17095
Show file tree
Hide file tree
Showing 2 changed files with 387 additions and 98 deletions.

0 comments on commit 9f17095

Please sign in to comment.