Apexcharts.js: min and max functions don't work properly with multi yaxis

Created on 23 Apr 2019  路  9Comments  路  Source: apexcharts/apexcharts.js

In my app I can have multiple yaxis in a single chart, they're all different variables with different min and max values. I've noticed that the min and max formatter for the yaxis works great when there is a single yaxis in the chart, but when there are multiple lines or multiple yaxis, it just gets the min and max value from all the series.

For example, I have a series which max and min values are 41629 and 8494 respectively and another series with 5 and 1 as max and min values. If they both appear in the chart, the max and min formatter for both yaxis gets 41629 and 1 because it gets the max and min from both series and it doesn't render the lines properly.

Here's a codepen to explain myself better:
https://codesandbox.io/s/069575mmv

See that one of the lines looks like a straight line but if you disable the other one, it will look better. You should also see that both yaxis have the same max and min values but they change when you disable one of the lines.

bug yaxis

All 9 comments

I am having the same issue, shown in this Codepen: https://codepen.io/azivkovi/pen/dypMzXm

Is there a way to get min & max for one of the multiple axis?

In the new version max value is calculating correctly, but the min value is faulty. The Codepen shows the issue in console:

pen.js:26 Max value: 1000
pen.js:22 Min value: 5e-324 // expected 400
pen.js:37 Max value: 9
pen.js:33 Min value: 5e-324 // expected 0

It appears there is a new bug now, but when you have two series plotted on a single y-axis and functionally declare min and max they are undefined.
If min and max are not set in y-axis options, everything is good.

Codepen: https://codepen.io/azivkovi/pen/dypMzXm

Apologies for headaches, Juned.

@azivkovi Ouch! should've tested it better. No worries, I will fix it soon.

Related #2098 ?

Released v3.23.0 which should fix this.

Something weird is happening still: https://codepen.io/azivkovi/pen/dypMzXm
For series [20, 41, 42, 43, 50, 60, 70, 80, 90, 100] max is shown as 104 and min is 16. I don't know what is special about that series, but if I try something else like [-2,1,3,4,5,6,7,70] it works as expected.
I assume min and max values have to be the min and max of the series.

Juned, you will notice there is still some lingering problem with min for two series: https://codepen.io/azivkovi/pen/dypMzXm

Series 1 min max: 0 & 100, expected: 20 & 100
Series 1 min max: 0 & 15, expected: 1 & 15

@junedchhipa I hope it's ok to continue conversation here, I can open a new issue if you prefer it that way. Thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artfulrobot picture artfulrobot  路  3Comments

pribilinskiy picture pribilinskiy  路  3Comments

felixalguzman picture felixalguzman  路  3Comments

thellimist picture thellimist  路  3Comments

ordago picture ordago  路  3Comments