1π
β
Here is the code:
var FV201_ctx = document.getElementById('FV201_chart').getContext('2d');
var FV201_cfg = {
type: 'line',
data: {
labels: FV201_timestamps,
datasets: [
{
label: 'temps',
data: FV201_temps,
type: 'line',
fill: false
}
]
},
options: {
title: {text: 'my chart', display: false},
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'second',
displayFormats: { second: 'hh:mm:ss' },
parser: function(foo) { return moment(foo,'X'); }
}
}],
yAxes: [{
ticks: {
suggestedMin: 28.5,
suggestedMax: 29,
stepSize: 0.1
}
}]
},
}
};
var FV201_chart = new Chart(FV201_ctx, FV201_cfg);
FV201_chart.update();
options
should not be insidedata
object.- x and y axes should be array types.
Source:stackexchange.com