Home forums Using CanvasJS How can I use PHP MySQL Dynamic data Reply To: How can I use PHP MySQL Dynamic data


$.getJSON(“livechart.php?type=drop&&node=”+node, function (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

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){
result.push({label: e[0].label,grpid:e[0].grpid,y: e[0].y});



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