Adjust yAxis problem


What I’m trying to do is to update “start”, “end” and “step” values of y-axis each time I receive new data from server. I’m using this approach:

chart.define('yAxis', {start: 0, end: 150, step: 4});

However chart after this manipulation gets scaled weirdly: . As you can see, blue value is 12, black is 25, but it looks like in total they are over 52.

This can be reproduced on official samples: … chart.html
Initially it looks fine. But once you execute following code in console:

myBarChart.define("yAxis", {start: 0, end: 120, step: 10});

it becomes -

However: … cales.html

myBarChart1.define("yAxis", {start: 0, end: 120, step: 10});

it is still OK -
Is this known/expected behavior? Is this true that it occurs only with stacked bar chart?

What would you recommend to adjust y-axis in runtime?

Thanks in advance.

Any ideas?

Seems that problem occurs on charts which show several series of data: … eries.html
CompanyB’s January value is 2.3
After this code executed

myLineChart.define("yAxis", {start: 0, end: 6, step: 1});

It looks like this - 2.3 is drawn between 1 and 2.

Update to prev post.

Seems that data which added by addSeries method doesn’t get scaled at all.
See this -
CompanyA’s line looks fine.
But green lines are identical on both charts!

There is no way to redraw charts this way. You need to call destructor() and rebuild chart every time you need to update “start”, “end” and “step” values of y-axis

Hi Darya
This is what I exactly made - I recreate chart each time I receive new data.
Thanks for reply.

But think the way chart behaves after

chart.define("yAxis", {start: 0, end: 6, step: 1});

is contradictory. Chart with single portion data gets redraw properly, but chart with series of data - does not. I think these to use cases should behave consistently.


Thanks for the comment. We will consider such opportunity in one of the following versions.