for (let i = 0; i < ydata.length; i++) {
                data.push({x: xdata[i], y: ydata[i]});
            }