Hi I am using google charts API, im calling a pie chart here is the code
google.setOnLoadCallback(drawChart);
function drawChart() {
$.ajax({
url:
"http://X3/playeruptime/system/?class=PlayerUptime&method=playerUptimePie&data={%22start%22:%222017-05-01%22,%22end%22:%222017-05-23%22}",
success: function(result){
var dat = JSON.parse(result);
var data = new google.visualization.DataTable();
data.addColumn('string', 'key');
data.addColumn('number', 'value');
data.addRows(dat);
// Set chart options
var options = {
'width':500,
'height':315,
is3D: true,
colors: [
"#64cc34",
"#ff0000"
],
animation: {
startup: true,
duration: 2000,
easing: 'in'
},
legend: {
position: 'right',
alignment:'center',
textStyle: {
fontSize: 35,
color: '#616161'
}
},
chartArea: {left: 0, top: 0, right:50, width: "100%",
height: "100%"}
};
// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.PieChart(document.getElementById('AverageUptimePie'));
chart.draw(data, options);
var onNum = dat[0][1];
var offNum = dat[1][1];
I need to know how do I reload the data in the charts periodically without
redrawing the charts in the sense that I dont want the chart to disappear
once data has been reloaded
Is there a redraw method that updates data to what it should be without
deleting chart
Thanks
--
You received this message because you are subscribed to the Google Groups
"Google Chart 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 https://groups.google.com/group/google-chart-api.
For more options, visit https://groups.google.com/d/optout.