Hi,
I have a line chart that looks like this:
* $.ajax({*
* url : "list/",*
* type : "GET",*
* data : ({*
* categoryName : name + "",*
* toTime : todayString + "",*
* fromTime : yesterdayString + ""*
* }),*
* aync : true,*
* dataType : "json",*
* error : function(e) {*
* alert(e.message + "ERROR ");*
* },*
* success : function(response) {*
* drawTablePresentStatus(name);*
* var jsonData = response;*
* *
* drawChart2(jsonData, response);*
* jsonData.tableData = {*
* "c1" : "data"*
* };*
* // drawTablePresentStatus(jsonData.tableData);*
*
*
* }*
* });*
*};*
*function drawChart2(jsonData, response) {*
*
*
* var data = new google.visualization.DataTable();*
* data.addColumn('datetime', 'timestamp');*
* data.addColumn('number', response[0].categoryName);*
* data.addColumn({*
* type : 'string',*
* role : 'tooltip'*
* });*
* *
* *
* *
* *
* var dt;*
* for ( var i in jsonData) {*
* dt = jsonData[i].toTime;// .split(/\-|\s/);*
* dat = new Date(dt);*
* var value = new Number(jsonData[i].value);*
* *
* var dateStr = dt;*
* var a=dateStr.split(" ");*
* var d=a[0].split("-");*
* var t=a[1].split(":");*
* var date = new Date(d[0],(d[1]-1),d[2],t[0],t[1],t[2]);*
*
*
* data.addRow([ date, parseInt(value, 10),*
* "Category: "+response[0].categoryName+"\n"+"Status:
"+jsonData[i].statusColor.toString()+"\n"+"Date & Time: "+dt.toString()]);*
* }*
* *
* var options = {*
* animation :{*
* duration : 50000,*
* easing : 'in'*
* },*
*
*
* title : name + " (" + response[0].unit + ")",*
*
*
* hAxis : { viewWindow : null},*
*
*
* hAxis :{ viewWindowMode : 'pretty'},*
* *
* pointSize : 3*
*
*
* };*
*
*
Can I do so this graph refreshes automatically somehow? for N seconds, It
fetches data from the datase if its worth mentioning. Thanks in forehand.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.