leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.48k stars 370 forks source link

When the data is too large, such as exceeding 1.00e+16, the y-axis cannot render properly? #906

Closed dingjunweibjkanyun closed 4 months ago

dingjunweibjkanyun commented 4 months ago
image
leeoniya commented 4 months ago

yes, the axis does not have unlimited resolution and uPlot only pre-generates tick increments up to 5e16:

https://github.com/leeoniya/uPlot/blob/bef151e62a5947641b2ba7734ba062823b03af9e/src/opts.js#L50-L59

i'm not sure i want to change this limit since values at these magnitudes are much better divided to more human numbers and the tick formatting callback adjusted to append a suffix or power to the tick labels. if your units are in Petabytes, you can just append PB to 1.234 instead of returning raw values in bytes like 1234123123123123.

for example, in Grafana we've had no requests or bug reports of users needing additional magnitudes.

leeoniya commented 4 months ago

if you really need such huge raw values, you can supply your own available tick increments using the axis.incrs option.

dingjunweibjkanyun commented 4 months ago

tks