Skip to content

aesh-charts: Axis tick format should auto-increase decimal precision for narrow data ranges #593

Description

@stalep

When the data range is very narrow, the auto-formatted tick labels lose precision and show duplicate values.

Example: Y-axis data ranges from 35.00 to 35.12. With the default one-decimal format, the ticks render as:

35.0
35.0
35.1
35.1
35.2

The first two ticks are indistinguishable (both show "35.0" but represent different values like 35.00 and 35.04). The third and fourth are also duplicates.

Expected: The formatter should detect when adjacent tick values would produce the same label and increase precision:

35.00
35.03
35.06
35.09
35.12

Suggested fix: In Axis.autoRange() or the tick formatting logic, after computing tick values, check if any adjacent ticks format to the same string. If so, increase the decimal places until all labels are unique, or base the format on the tick interval size (e.g., interval < 0.1 → use 2 decimals, interval < 0.01 → use 3 decimals).

Discovered while charting Autobench Single Core values in h5m (range ~35.0 to ~35.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions