Skip to content

[Feature] Add support for non base 10 tick intervals #21208

@bg451

Description

@bg451

What problem does this feature solve?

ECharts should support non base 10 nice tick intervals. The goal is for tick intervals to align nicely with other bases, such as base 2 or base 1024, so that the converter can support KMB formatting.

Specifically, if I'm formatting the ticks to be base 2 bytes, we run into an issue where the tick intervals don't line up with nice numbers. ECharts will pick, say, 10000, 20000, 30000, 40000, and 50000, which, in base 10, lines up nicely with 10k, 20k, 30k, 40k, and 50k. However, with base 2 bytes, those intervals end up spitting out 9.5 Mib, 19Mib, etc. etc. Ideally, the intervals that echarts calculates should align at 10485760, 20,971,520, etc.

Another example would be setting the tick interval to be aligned with minutes, assuming the underlying data type is seconds.

This would help catch up ECharts axis formatting with Grafana and d3.

There's a rather good comment about this on an email chain

What does the proposed API look like?

axis.intervalBase could possibly work?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions