Skip to content

Commit 1cb2e55

Browse files
fix: do not render google charts if the data is not available
1 parent 6c33b99 commit 1cb2e55

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/render-google.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,18 @@ var isResizeRequest = false;
1414
var rendered_charts = [];
1515

1616
function renderChart(id) {
17+
18+
if ( ! all_charts || 0 === Object.keys( all_charts ).length ) {
19+
return;
20+
}
21+
1722
var chart = all_charts[id];
1823
var hasAnnotation = false;
1924

25+
if ( ! chart ) {
26+
return;
27+
}
28+
2029
// re-render the chart only if it doesn't have annotations and it is on the front-end
2130
// this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
2231
// remember, some charts do not support annotations so they should not be included in this.

0 commit comments

Comments
 (0)