I'm wondering if you shouldn't just rethinkInstead of using Google's google.setOnLoadCallback(drawChart);
event in your solution. In my opinionjavascript, you're adding an unnecessary post back to the pagetry using _spBodyOnLoadFunctionNames.push("drawChart");
. Instead of having
My theory is that by the server re-writetime Google's API has loaded, your JavaScriptpage's DOM has not been fully built, include both charts on the page and use CSSso there is no "chart_div" to layer them on top of each otheraccess. Hide the second chart
Sidenote: I would recommend using CSS, and then use a simple JavaScript function to switch between the two charts when they click on the radio buttonsStringBuilder class instead of all of that concatenation. The user will experience a smaller delay between switching It has nothing to do with your problem, and it won't require loadingbut doing an entire SharePoint page over again, whichAppendLine("...")
is already a slow processeasier than putting \n
everywhere. Feel free to ignore this if you want.