fix: make top_count nonzero

This commit is contained in:
Yingjie Wang 2024-11-06 13:06:16 -05:00
parent 0e396728c6
commit 89532428d5

View File

@ -153,7 +153,7 @@ class RankingGenerator:
reverse_bar_x = face_x + offset
top_bar_width = (width - face_size) / 2 + offset
if top_count is None:
top_count = max(max(counts), abs(min(counts)))
top_count = max(max(counts), abs(min(counts)), 0.001)
chart = PicGenerator(width, (face_size * count) + (row_space * (count - 1)))
chart.set_row_space(row_space)