JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
title:{
text: "Probes test"
},
axisX: {
valueFormatString: "DD/MM/YY HH:mm:ss",
labelFormatter: function(e){
console.log(e.value);
return e.value.toLocaleTimeString();
}
},
axisY: {
title: "Temperature (°C)",
suffix: " °C"
},
legend:{
cursor: "pointer",
fontSize: 16,
itemclick: toggleDataSeries
},
toolTip:{
shared: true
},
data: [{
name: "Probe 1",
type: "spline",
yValueFormatString: "#0.## °C",
showInLegend: true,
dataPoints: [
{ x: new Date(2021,9,31,0,0,0), y: 27},
{ x: new Date(2021,9,31,0,15,0), y: 26},
{ x: new Date(2021,9,31,0,30,0), y: 29},
{ x: new Date(2021,9,31,0,45,0), y: 28},
{ x: new Date(2021,9,31,1,0,0), y: 25},
{ x: new Date(2021,9,31,1,15,0), y: 28},
{ x: new Date(2021,9,31,1,30,0), y: 30 },
{ x: new Date(2021,9,31,1,45,0), y: 31 },
{ x: new Date(2021,9,31,2,0,0), y: 26 },
{ x: new Date(2021,9,31,2,15,0), y: 30 },
{ x: new Date(2021,9,31,2,30,0), y: 30 },
{ x: new Date(2021,9,31,2,45,0), y: 29 },
{ x: new Date(2021,9,31,3,0,0), y: 31 },
{ x: new Date(2021,9,31,3,15,0), y: 30 },
{ x: new Date(2021,9,31,3,30,0), y: 29 },
{ x: new Date(2021,9,31,3,45,0), y: 27 },
{ x: new Date(2021,9,31,4,0,0), y: 31 }
]
},
{
name: "Probe 2",
type: "spline",
yValueFormatString: "#0.## °C",
showInLegend: true,
dataPoints: [
{ x: new Date(2021,9,31,0,0,0), y: 20 },
{ x: new Date(2021,9,31,0,15,0), y: 20 },
{ x: new Date(2021,9,31,0,30,0), y: 21 },
{ x: new Date(2021,9,31,0,45,0), y: 27 },
{ x: new Date(2021,9,31,1,0,0), y: 21 },
{ x: new Date(2021,9,31,1,15,0), y: 27 },
{ x: new Date(2021,9,31,1,30,0), y: 21 },
{ x: new Date(2021,9,31,1,45,0), y: 25 },
{ x: new Date(2021,9,31,2,0,0), y: 23 },
{ x: new Date(2021,9,31,2,15,0), y: 20 },
{ x: new Date(2021,9,31,2,30,0), y: 24 },
{ x: new Date(2021,9,31,2,45,0), y: 25 },
{ x: new...