Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
c5729dc
commit aee476c
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aee476c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This partially fixes the issue, but the halfPointRange needs adjusting as well as the goingLeft flag. Otherwise, the extremes get set incorrectly when zoomed, and when not zoomed you can scroll past the normal min/max.
I suggest add a variable for reversed:
reversed = axis.reversed,
Change halfPointRange declaration line to this:
halfPointRange = (axis.pointRange || 0) / 2 * (reversed ? -1 : 1),
(added the reversed check at the end)
And modify your new if statement to look like this:
if (reversed) { goingLeft = startPos < mousePos tmp = newMin; newMin = newMax; newMax = tmp; }
(Uses the reversed var now, and added the goingLeft check with opposite comparison)
I tested this on the newest public version of Highcharts and was able to successfully pan in normal and reversed xAxis.
aee476c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Drumstix42 Great catch, thanks for your comment!