mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-27 03:15:55 +03:00
[GH-ISSUE #95] LineChart should limit the use of decimal digits on the Y axis #61
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mum4k on GitHub (Jan 27, 2019).
Original GitHub issue: https://github.com/mum4k/termdash/issues/95
The following screenshot demonstrates the issue:
All the values are integers in the range of 1600-1800, yet the LineChart shows floating point values. This is because when the LineChart calculates the value of each cell row (called the step) it ends up being a floating point number.
Step of the Y axis is calculated here:
github.com/mum4k/termdash@1e1dc15c47/widgets/linechart/axes/scale.go (L65)The labels are determined here:
github.com/mum4k/termdash@1e1dc15c47/widgets/linechart/axes/label.go (L85)We could add a conditional and if the step between two adjacent rows is larger than X (say 10 or 20?) the generated label will rounded to the nearest integer.