Elina,
To render the dataPoint with one array for x value and other array for y values, you need to parse the arrays according to data format accepted by CanvasJS. Check out the below code snippet for parsing the arrays.
function parseDataPoints() {
for (var i = dps.length; i < dateArray.length; i++)
dps.push({
x: new Date(dateArray[i]),
y: numberArray[i]
});
};
Please take a look at this JSFiddle for complete code sample.
![Chart with user input data and parsing from array](https://canvasjs.com/wp-content/uploads/2021/03/chart-with-user-input-data-and-parsing-from-array.png)
—-
Sanjoy Debnath
Team CanvasJS