Home Forums Report Bugs Line Graph Point Connection Bug Reply To: Line Graph Point Connection Bug

#14195

@Vishwas R ,Thank you for replay question.
I added the sort before the chart,render() , I leave you the new code :
function updateEcg() {
$.getJSON(“/data_ecg4.php”, function (result) {
if (dataLength !== result.length) {
for (var i = dataLength; i < result.length; i++) {
data.push({
x: parseInt(result[i].valuex),
y: parseFloat(result[i].valuey),
});
if (data.length > 478) {
data.shift(); }}
dataLength = result.length;
data.sort((a,b)=>a-b);
chart.render();} });
Is correct my idea? or I need to change something? , thanks in advice.