This code is working fine but I can not use variables
S and A outside the function as global variables ! Why,
in spite of definition for global variables inside the
function, I have in console the error message: S and A not
defined ?
var Xa = 0
var updateInterval = 10;
var updateChart = function () {
S = 35;
A = Math.sin(Xa * Math.PI / 180);
dps.push({ x:Xa ,y:A });
Xa++;
while(dps.length >= 720){
dps.shift();}
chart.render();
};
setInterval(function(){updateChart()}, updateInterval);
console.log (S);
console.log (A);