I am working with a chart that utilizes the events.load
function to draw lines based on the properties of the chart.
The load function is functioning as expected, but I want to erase and redraw the lines each time the chart is redrawn, such as when hiding a series.
I tried adding the same erasing function to the chart.events.redraw
function, thinking it would work. However, the object passed to the redraw()
function contains the previous chart properties, not the updated ones.
For instance, in the provided example (see fiddle), if you hide Canada, the x-axis changes but the lines are not rendered. Then, if you un-hide Canada, the chart is redrawn with the old properties.
Is there a way to redraw the chart with the newly updated properties? Thank you!
events: {
load: function() {
var ren = this.renderer;
// Code for drawing lines based on chart properties
},
redraw: function() {
// Code for clearing and redrawing lines based on updated chart properties
}
}