-
Notifications
You must be signed in to change notification settings - Fork 136
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
Updating yaxis min and max #17
Comments
If I create a new object it does work
|
Looking at the code
would it help to add the deep: true property?
|
Which version of apexcharts/Vue-apexcharts are you using? Here is a codesandbox demo of updating yaxis values working correctly. |
I can confirm that this method works
but if we add the deep: true property, couldn't I do this?
I guess there's not much in it, it just looks a bit neater. |
The For eg, in your example yRangeChanged(min, max) {
this.options.yaxis.min = min;
this.options.yaxis.max = max;
} the updateOptions() method would fire twice, and update() is a costly method as it redraws the entire chart. |
Fair point. I do get a strange side affect though when using
I have a data set with 60 points, if I initially set my xaxis min to 0 and max to 10, it correctly shows the first 10 points. Then I change the yaxis min and max with the above code. It resets my axis range to 0 to 60, even if I do this.
is this the expected behaviour? |
No, not expected behavior. Working example on codesandbox |
By the way, thanks for all your help. I've tried copying all my settings into the codepen and your quite right, it doesn't behave like that. But when I run exactly the same code on my site, it rescales the X as well. I can't see any difference in how we're doing it. For now I will manually edit the data series to just what I need, this will have the same effect. |
I'm trying to update the yaxis min and max through the options object
But this doesn't work. The object is correctly updated, but the Y axis range stays the same. If I manually set yaxis.min and yaxis.max to begin with, the graph displays correctly. I noticed a commit which added a Yaxis prop, but it looks like this was taken out straight away.
Am I missing something when trying to update these values?
The text was updated successfully, but these errors were encountered: