I have two time series for example:
s1:
2017-01-06 18:39:30 100
2017-01-07 18:39:28 101
and
s2:
2017-01-07 18:00:00
You can have data of the form [{x:"value", y:"value"}] when your graph is of type scatter.
So to make your graph work, do this.
var canvas = document.getElementById("graph");
var s1 = [{x:"2017-01-06 18:39:30",y:"100"},{x:"2017-01-07 18:39:28",y:"101"}];
var s2 = [{x:"2017-01-07 18:00:00",y:"90"},{x:"2017-01-08 18:00:00",y:"105"}];
var graphParams = {
type:"scatter",
data:{
datasets: [{
label:"Series 1",
data:s1,
borderColor:"red",
backgroundColor:"transparent",
},
{
label:"Series 2",
data:s2,
borderColor:"blue",
backgroundColor:"transparent",
}],
},
options:{
maintainAspectRatio:false,
responsive:false,
scales:{
xAxes:[{
type:"time",
distribution: "series",
}],
}
}
}
ctx = new Chart(canvas, graphParams);