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

Scaling doesn't take ticks min/max into account #7575

Closed
klausenbusk opened this issue Jun 30, 2020 · 5 comments
Closed

Scaling doesn't take ticks min/max into account #7575

klausenbusk opened this issue Jun 30, 2020 · 5 comments

Comments

@klausenbusk
Copy link

Expected Behavior

When the dataset is "filtered" by using min/max, the scaling of the y-axes should use the "filtered" dataset.

Current Behavior

The scaling is calculated from the full dataset and not the "filtered" dataset.

Possible Solution

Use the "filtered" dataset when calculating scaling?

Steps to Reproduce

https://jsfiddle.net/0426Lvsb/ (click magic and notice that the y-axis scale doesn't change)

Context

I'm using Chart.js to show download stats for Flathub and you can choose a interval (infinity, 365 days, 30 days, 14 days). Some of the data contains some high spikes, which means when you choose 14 days the scaling doesn't match the shown data (most of the chart is empty).

Link: https://klausenbusk.github.io/flathub-stats/

Environment

Chart.js version: 2.9.3
Browser: Firefox Nightly
Project: https://github.com/klausenbusk/flathub-stats/ (deployed here)

@benmccann
Copy link
Contributor

I believe this works the way you'd like it to with 3.0.0-alpha. Can you give it a try?

@klausenbusk
Copy link
Author

I believe this works the way you'd like it to with 3.0.0-alpha. Can you give it a try?

I just tried and it does: https://jsfiddle.net/b72kfd9e/14 I assume we can close this issue?

@leeoniya
Copy link

@benmccann didn't you guys default lineTension to 0 as part of #7386?

clicking "magic" in this fiddle produces an "interesting" curve ;)

@etimberg
Copy link
Member

@leeoniya we did, but I believe that was after the first alpha release. I think we're quite close to a 2nd alpha (#7435 is the big thing we're trying to get in)

@benmccann
Copy link
Contributor

I'm closing this since it sounds like it's addressed. Let me know if there's still something that needs to be looked at

klausenbusk added a commit to klausenbusk/flathub-stats that referenced this issue Sep 1, 2020
The most notable change in relation to our use case, is that min / max
is taken into account when scaling the graph[1].

[1] chartjs/Chart.js#7575
klausenbusk added a commit to klausenbusk/flathub-stats that referenced this issue Apr 3, 2021
The most notable change in relation to our use case, is that min / max
is taken into account when scaling the graph[1].

[1] chartjs/Chart.js#7575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants