Pages

Monday 28 November 2011

setTimeOut() javascript function

function timer()
 {   
  // Calculate new YValue for the DataPoint
  var newYValue = Math.abs(Math.random() * 100 - 10 * dataPointIndex);

  // Update a YValue property of a DataPoint
  updateYValue(newYValue, dataPointIndex);

  // Update dataPointIndex
  dataPointIndex = (dataPointIndex > 4) ? 0 : dataPointIndex + 1;

  // Set timeout for timer() function
  setTimeout(timer, 5000);
 }

No comments:

Post a Comment