- Code: Select all
function RedrawChartUponOrientationChange() {
Data.chart.showLoading();
var w = !UseModernLibrary() ? GetOldLibChartWidth() : GetModernLibChartWidth();
var h = !UseModernLibrary() ? GetOldLibChartHeight() : GetModernLibChartHeight();
Data.chart.setSize(w,h); //fills to size of screen
Data.chart.hideLoading();
Data.chart.redraw();
}
If I execute a swipe or tap on the chart after this, (which invokes the redraw() method after changing the series), the axis pops back into the correct position. I've tried simply calls a second redraw after a timeout but that doesn't fix to it, which suggests to me that maybe something actually needs to change on the chart to properly trigger the redraw.
Any ideas on how this could be happening?
If i can't get this working will probably have to come up with a dirty hack, thinking, after orientation, detect the y axis in the Dom, get its offset().left value, and if its over say 50, then try manually change it or somehow invoke a proper second redraw.