Skip to content

Better tick placement for scales with binary tick formatting #1395

@flash1293

Description

@flash1293

Is your feature request related to a problem? Please describe.

As explained in this issue elastic/kibana#7539 - a bytes formatter is dividing the raw number of a tick by powers of two like 1024 or 1048576 before displaying the value. Elastic charts tries to find "nice" tick placements like 500 or 1000 which lead to odd looking tick labels

Describe the solution you'd like
It should be possible to instruct elastic-charts to try to place ticks at different positions which are a better fit for the formatter (like 1024 or 1048576 instead of 1000 and 1000000)

Describe alternatives you've considered
If the formatter is using the same unit (like KB) for each tick, it would theoretically be possible to divide the actual value in the data array by 1024, then multiplying by 1024 again before formatting the label. Elastic charts would try to find nice tick placements like 1, which will be turned into 1KB by formatting.

Kibana Cross Issues
elastic/kibana#7539

Checklist

Delete any items that are not applicable to this feature request.

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions