Skip to content

Commit b1482b2

Browse files
Merge pull request #701 from contactashish13/issue-700
Changing the viewport or resizing the window causes annotation-based charts to show an error
2 parents ea128d2 + c7d8f7d commit b1482b2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/render-google.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ var __visualizer_chart_images = [];
1212
var rendered_charts = [];
1313

1414
function renderChart(id) {
15+
var chart = all_charts[id];
16+
var hasAnnotation = false;
17+
if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined'){
18+
hasAnnotation = chart.series.length - chart.settings.series.length > 1;
19+
}
20+
// re-render the chart only if it doesn't have annotations and it is on the front-end
21+
// this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
22+
if(hasAnnotation){
23+
return;
24+
}
1525
renderSpecificChart(id, all_charts[id]);
1626
}
1727

0 commit comments

Comments
 (0)