I create a chart basing on user ranking that I get from database, I've a page where I list all the users (Users.jsp) and I load with ajax the user details (userDetails.jsp), in the user details I create the chart with the parameters that I receive depending the user:
String user = (request.getParameter("username") != null ) ? request.getParameter("username") : ""; String isWebUser = (request.getParameter("isWebUser") != null ) ? request.getParameter("isWebUser") : ""; <!--Here I fill the array with some values and I pass those values to the chart--> <script type="text/javascript" src="https://www.google.com/jsapi?autoload={ 'modules':[{ 'name':'visualization', 'version':'1', 'packages':['corechart'] }] }"></script> <!-- <script type="text/javascript" src="https://www.google.com/jsapi"></script>--> <script type="text/javascript"> //google.load('visualization', '1', {packages: ['corechart', 'line']}); //google.load('modules':[{'name':'visualization', 'version':'1', 'packages':['corechart']}]); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Notas','<%=user%>','<%=usuario7d %>'], <% for ( int j=0; j < 7; j++) { %> [ <%=j %>, <%=vectFinal_7[j][1] %>, <%=vectFinal_7MR[j][1] %> ], <% } %> ]); var options = { title: '7 dias', curveType: 'function', legend: { position: 'bottom' } }; var chart = new google.visualization.LineChart(document.getElementById('curve_chart_7')); chart.draw(data, options); } </script> <script type="text/javascript"> google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Notas','<%=user%>','<%=usuario30d %>'], <% for ( int j=0; j < 30; j++) { %> [ <%=j %>, <%=vectFinal_30[j][1] %>, <%=vectFinal_30MR[j][1] %>], <% } %> ]); var options = { title: '30 dias', curveType: 'function', legend: { position: 'bottom' } }; var chart = new google.visualization.LineChart(document.getElementById('curve_chart_30')); chart.draw(data, options); } </script> The point is that when I called this jsp the chart is rendered but when I called the first page where I list the users and then called one particular I have this error: A call to document.write () from a loaded external script asynchronously was ignored. I really don't know why <!--Load the AJAX API --> <script type="text/javascript" src="http://www.google.com/jsapi"></script> don't load correctly. Can someone help me? -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.