New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis.getExtremes() return invalid dataMin value #5493

Closed
kpau opened this Issue Jul 15, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@kpau

kpau commented Jul 15, 2016

Live demo with steps to reproduce

http://jsfiddle.net/dot7ebrx/2/

Create chart with two series, legend and range selector.
The second series doesn't have data for the entire range, for which the first one has (e.g. the first has data for 01.01.2000 - 05.01.2000, the second has for 02.01.2000 - 04.01.2000).
Hide the first (longer) series using the legend. The selected range is changed, so only the second series are visible on the plot (we can also see that in the navigator).
Click 'All' from the range selector. The chart plot doesn't change, but the navigator is updated so the whole range is selected (including the first series).
Click getExtremes() button, which calls chart.xAxis[0].getExtremes(); and prints the result in the console.
Note: The demo generates random Y data on each run, but for every run I made the issue was reproduced.

Actual behaviour

dataMin equals 01.01.2000 - the start date for the first series (which are hidden).
dataMax equals 04.01.2000 - the end date for the second series (which are the only visible series).

Expected behaviour

Either one of the two:

  • dataMin and dataMax equals 01.01.2000 and 05.01.2000 - the first and the last date from the first series (uses all series to calculate the min/max data).
  • dataMin and dataMax equals 02.01.2000 and 04.01.2000 - the first and the last date from the second series (uses only the visible series to calculate the min/max data).

The current documentation of Axis.getExtremes() doesn't specify which is the expected behavior, although in the other cases, it uses only the visible series to calculate min/max.

Affected browser(s)

OS: Windows 8.1 (64-bit)

Google Chrome 51.0.2704.103 m (64-bit)
Firefox Developer edition 49.0a2 (2016-07-12)
Internet Explorer 11.0.9600.18283

@pawelfus

This comment has been minimized.

Contributor

pawelfus commented Jul 15, 2016

Hi @kpau, thank you for reporting! I agree, it's strange to get minimum from all series, and maximum from only visible series. This is most probably caused by dataGrouping, when disabled it works fine: http://jsfiddle.net/dot7ebrx/5/ (imho only visible series should return extremes).

Internal note:
Most probably, minimum is set here which cause the issue above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment