$.getJSON(“livechart.php?type=drop&&node=”+node, function (result) {
dps=result;
var chart1 = new CanvasJS.Chart(“dynamicdropContainer”,{
title :{
text: “”
},
axisX: {
title: “Time”
},
axisY: {
title: “Packets Drop”,
minimum: 0,
},
data: [{
type: “column”,
indexLabelFontColor: “black”,
color: “red”,
dataPoints : dps
}]
});
chart1.render();
var xVal = result.length + 1;
var yVal = result;
var updateInterval = 1000;
var count=0;
var updateChart = function () {
var group_id=result[result.length-1].grpid+1;
$.getJSON(“newdata.php?type=drop&&node=”+node+”&&grpid=”+group_id, function (e){
if(e[0].label.length!=0){
result.push({label: e[0].label,grpid:e[0].grpid,y: e[0].y});
}
});
if(result.length-count>=250){
result.shift();
}
chart1.render();
};
setInterval(function(){updateChart()}, updateInterval);
});
here first iam getting 300 records and next from newdata.php in update function am getting one by one record which i push the record to result and render the chart .. when i did n’t use shift or aplice am getting the chart with all the records but when iam using shift or splice then my chart structs on right hand side.
could you please check is there any mistake in my code
Hi,
and one more observation when i am pushing elements and splicing the result array .. on left side it is splicing the first element and graph is moving but on right hand side results are not updating.
is it possibility to change in the library which you provides , if so please tell me . i have to hard code it for my internal presentation.
hello please respond any one
we have some machines connected to each other , i am able to get network packet count from all the machines and display the stats like dynamic line chart which is shown below link
could u help me how to set two charts on a single page (one is pie chart and another one is dynamic line graph) with php and mysql
Hi anjali ,
Thanks it works fine..
i want one more requirements is there any MRTG(multi route traffic generator) framework available from dynamic chart, i want to get the network stats from the different systems and display charts just like network monitoring .