I have created a chart where I’ve added an image.
Now when I click this image I want to set the yAxis max to a specific point, and when I click it again to reset the yAxis to the original values.
This is the jsfiddle for it: http://jsfiddle.net/inadcod/TynwP/
I have managed to add the image, to add a click event to the image, but it’s as far as I got.
Can anyone help me out with this? Thanks!
I have created a chart where I’ve added an image. Now when I click
Share
There are two ways to do what you want.
First way:
The problem is that it’s not possible to update chart options and then
redrawto get it updated, you have todestroyand then create it again like the following.So, for this you can store your chart
optionsinto a var and then pass as parameter.Demo
Second way:
redrawisn’t called if you just updateaxisdata like the following.chart.yAxis[0].max = 25;, that’s why I suggested the way above.But if you set
chart.yAxis[0].isDisty = true;and callchart.redraw();, it will work. You can see my demo bellow.Demo