summaryrefslogtreecommitdiff
path: root/histogram.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-06-02 21:43:08 -0700
committerScott Gasch <[email protected]>2022-06-02 21:43:08 -0700
commitba21e38cdb3d504a69f6808913ea2a649ab4e916 (patch)
treeb262b0a0d968c84ab3c16ebc0927f932ca14a3ec /histogram.py
parent19c9d04094b49b25826b875bf06e5e622f97e1d5 (diff)
Make the bar graph thing do fractions.
Diffstat (limited to 'histogram.py')
-rw-r--r--histogram.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/histogram.py b/histogram.py
index 86d0493..ee1601a 100644
--- a/histogram.py
+++ b/histogram.py
@@ -165,7 +165,7 @@ class SimpleHistogram(Generic[T]):
some vital stats about the population in it (min, max, mean,
median, mode, stdev, etc...)
"""
- from text_utils import bar_graph
+ from text_utils import BarGraphText, bar_graph_string
details = self._get_bucket_details(label_formatter)
txt = ""
@@ -187,9 +187,10 @@ class SimpleHistogram(Generic[T]):
if start < details.lowest_start:
continue
label = f'[{label_formatter}..{label_formatter}): ' % (start, end)
- bar = bar_graph(
- (pop / details.max_population),
- include_text=False,
+ bar = bar_graph_string(
+ pop,
+ details.max_population,
+ text=BarGraphText.NONE,
width=bar_width,
left_end="",
right_end="",