You must be logged in to post your query.
Home › Forums › Chart Support › How to remove json source ?
Tagged: synchronized charts offline datasource
Hello, I’m trying to remove the json source from your example “synchronized charts” , the static datasource works but when I remove the json file in order to work offline, it desn’t work, Can you help ? I want remove this part :
$.get("https://canvasjs.com/data/gallery/javascript/server-matrics.json", function(data) { for (var i = 1; i < data.length; i++) { systemDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].system)}); userDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].user)}); waitDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].wait)}); buffersDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].buffers)}); cacheDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].cache)}); usedDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].used)}); inboundDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].inbound)}); outboundDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].outbound)}); writeDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].write)}); readDps.push({x: parseInt(data[i].time), y: parseFloat(data[i].read)}); } for( var i = 0; i < charts.length; i++){ charts[i].options.axisX = { labelAngle: 0, crosshair: { enabled: true, snapToDataPoint: true, valueFormatString: "HH:mm" } } } syncCharts(charts, true, true, true); // syncCharts(charts, syncToolTip, syncCrosshair, syncAxisXRange) for( var i = 0; i < charts.length; i++){ charts[i].render(); } });
Hello, it was simple :) just this code works :
for( var i = 0; i < charts.length; i++){ charts[i].options.axisX = { labelAngle: 0, crosshair: { enabled: true, snapToDataPoint: true, valueFormatString: "HH:mm" } } } syncCharts(charts, true, true, true); // syncCharts(charts, syncToolTip, syncCrosshair, syncAxisXRange) for( var i = 0; i < charts.length; i++){ charts[i].render(); }
@punchilla,
Glad you figured it out :)
___________ Indranil Deo Team CanvasJS
You must be logged in to reply to this topic. Login/Register