-
Notifications
You must be signed in to change notification settings - Fork 5
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
Lock zoom box #178
base: development
Are you sure you want to change the base?
Lock zoom box #178
Conversation
This change will prevent someone from zooming out into the abyss
accidentally left this in
fixes #134 |
@@ -4364,6 +4375,14 @@ | |||
} | |||
} | |||
}); | |||
//sets the zoom and pan limits for the individual class graphs | |||
charts[id+1].options.plugins.zoom.limits = { | |||
xAxis: {min: minDate, max: maxDate}, |
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.
Do you define minDate
and maxDate
anywhere in this function?
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.
lines 4159 and 4160
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.
Wait nevermind I'll fix it
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.
lines 4159 and 4160
Those lines are in a different function and the variables appear to be implicitly declared, which is not good practice. If you intend for them to be global variables, you should explicitly declare them using let
in the global scope.
let maxDate = Infinity; | ||
let minDate = Infinity; |
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.
These declarations are still only in the scope of renderOverviewChart()
. Also, can you explain your rationale for initializing these to Infinity
?
This change will prevent someone from zooming out into the abyss