rgraph - javascript animation of a water tank -


i trying use rgraph library manipulate vertical progress bar, i'm stuck because after creating progress bar can't manipulate properties, here's code have been using:

 window.onload = function () {     // create object. arguments are: canvas id, indicated value , maximum value.     var myprogress = new rgraph.vprogress('myprogress', 60, 100)          // configure chart want.         .set('chart.colors', ['blue'])          .set('chart.tickmarks',['true'])          .set('chart.tickmarks.color',['white'])          .set('chart.title',"nivel")          // call .draw() method draw chart.         .draw();     } 

and after try read value property using click on button,but says undefined:

function myfunction() {    var valor= myprogress.value;    alert(valor);   } 

how can access properties of object created in function? idea change level of progress bar according control put in webpage.

thanks in advance supplied.

myprogress scoped within onload handler, can't seen other functions out of scope.

var myprogress; window.onload = function() {     myprogress = new rgraph.vprogress('myprogress', 60, 100)     // ... }; 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -