Hello, I encountered an error in my Java script when trying to run it from the server side. The script includes a for loop that runs over 3000 times and retrieves values from an array with more than 3000 elements. Here is the script:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addRows(count);
for (var i=0;i<count;i++)
{
data.setValue(i, 0, '"+Dvar[i]+"');
data.setValue(i, 1, "+Pvar[i]+");
}
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, title: 'Company Performance'});
}
</script>
Since this script is being used on the server side, it is in string format outside of the main body. The counts mentioned are located in the arrays Dvar and Pvar, and the count value will exceed 3000. If there are any errors related to the loop in this script, I would appreciate any advice or suggestions.