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

Can't update scale #5461

Closed
Fr33dan opened this issue Apr 30, 2018 · 3 comments
Closed

Can't update scale #5461

Fr33dan opened this issue Apr 30, 2018 · 3 comments

Comments

@Fr33dan
Copy link

Fr33dan commented Apr 30, 2018

Expected Behavior

After updating a specific scale either by its index and calling chart.update() the scales should change to reflect the new value as shown in the documentation.

Current Behavior

After updating the scale and calling chart.update() nothing happens.

Possible Solution

There are a couple of bugs (#4896 , #5452) that note issues with scales.ticks but the min and the max exist outside the ticks object so I thought I should create a new issue. It may be related.

Steps to Reproduce (for bugs)

Bug demonstrated in JS fiddle.

Context

The JS fiddle is pretty much copied and pasted from my actual project but without the overhead of the code that loads the data so there aren't any datasets, but the behavior is the same regardless.

Environment

  • Chart.js version:2.7.2
  • Browser name and version: Chrome 66.0.3359.139, Firefox 59.0.3
@qw4n7y
Copy link

qw4n7y commented Sep 26, 2018

Any progress on that? Need that to fit all data into viewport on update

@SENSEi-James
Copy link

You're updating the wrong properties in your updateChart function.

Change
graphCanvas.scatterChart.options.scales.yAxes[0].max = 0.02;
To
graphCanvas.scatterChart.options.scales.yAxes[0].ticks.max = 0.02;

@nagix
Copy link
Contributor

nagix commented Jan 6, 2019

Closing this as @SENSEi-James says, min and max are the tick configuration options as described in Linear Axis and Logarithmic Axis. Once the properties in the example are changed, it works as expected.

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

5 participants