You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] able to customize the dataMax/dataMin of axis rather than fixed max/min #20770
changed the title [-][Feature] How to customize the dataMax/dataMin of axis rather than fixed max/min[/-][+][Feature] able to customize the dataMax/dataMin of axis rather than fixed max/min[/+]on Feb 20, 2025
It's realy a good solution for simple cases.
However, mantaining a function to handle many edge cases — such as negtive, small numbers, big numbers — can be quite annoying.
ECharts already handles these cases effectively.
All we need is a new API to seamlessly integrate our custom dataMax/dataMin values.
Another possible workaround would be to use an inviseble helper series that only contains your min and max values. Could be problematic combined with tooltip: { trigger: 'axis' }.
Another possible workaround would be to use an inviseble helper series that only contains your min and max values. Could be problematic combined with tooltip: { trigger: 'axis' }.
Yes. It's exactly the workaround i'm using for now.
I append an invisible line series to meet the requirement, but an official API would be much better
Activity
[-][Feature] How to customize the dataMax/dataMin of axis rather than fixed max/min[/-][+][Feature] able to customize the dataMax/dataMin of axis rather than fixed max/min[/+]linghaoSu commentedon Feb 20, 2025
The scale attribute in the axis options might be what you need.
doc demo
Justin-ZS commentedon Feb 20, 2025
No. The
scaleis used for other cases and doesn't work when max/min are setMatthiasMert commentedon Feb 20, 2025
You can pass a function to axis.min / axis.max and compute the axis boundary values from the min and max in your data.
Example
Justin-ZS commentedon Feb 20, 2025
It's realy a good solution for simple cases.
However, mantaining a function to handle many edge cases — such as negtive, small numbers, big numbers — can be quite annoying.
ECharts already handles these cases effectively.
All we need is a new API to seamlessly integrate our custom
dataMax/dataMinvalues.MatthiasMert commentedon Feb 20, 2025
Another possible workaround would be to use an inviseble helper series that only contains your min and max values. Could be problematic combined with
tooltip: { trigger: 'axis' }.Example
Justin-ZS commentedon Feb 21, 2025
Yes. It's exactly the workaround i'm using for now.
I append an invisible line series to meet the requirement, but an official API would be much better