Skip to content
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

Graph zoom fix #137

Closed
wants to merge 0 commits into from
Closed

Conversation

tatertotbot
Copy link

The graph cannot be zoomed out farther than 0-100 on the y axis and the date of the first and last assignment for the x axis.
Also, suggestedMax was changed to 100 rather than 110 to fit into this zoom restriction.

Note: this is only for the main graph because I don't have any data for specific classes and I would rather not mess anything up, but rather do this first.

Comment on lines 3666 to 3674
let allDates = [];
for (let data of chartData) {
if (data && data.assignmentDates) {
allDates = allDates.concat(data.assignmentDates);
}
}
allDates = allDates.map(dateStr => new Date(dateStr));
const earliestDate = new Date(Math.min(...allDates));
const latestDate = new Date(Math.max(...allDates));
Copy link
Member

@jjoelj jjoelj Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to calculate these instead of using the startDate and endDate variables that exist in this scope? Also, use spaces not tabs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't use it cause there's like almost 5000 lines and I wasn't gonna read through all that so I never found those variables, but I can change it

}
}, limits: {
xAxis: {min: earliestDate, max: latestDate},
yAxis: {min: 0, max: 100}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this react to extra credit that brings someone's grade above 100?

Comment on lines 3820 to 3822
xAxis: {min: earliestDate, max: latestDate},
yAxis: {min: 0, max: 100}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tabs should be spaces too

@jjoelj jjoelj linked an issue Aug 13, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add limits on chart zoom out
2 participants