chart.js time line chart
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.bundle.min.js"></script>
<div style="width: 100%; height: 100%">
<canvas id="test"></canvas>
</div>
JavaScript
var ctx = document.getElementById("test").getContext("2d");
var scatterChart = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
label: 'Measurements',
data: [{ x: "2020-06-16", y: 178 }, { x: "2020-07-13", y: 201 }, { x: "2020-07-14", y: 187 }]
}]
},
options: {
scales: {
xAxes: [
{
type: 'time',
time: {
min: "2020-06-16",
max: "2020-07-14"
}
}
],
yAxes: [{
ticks: {
maxTicksLimit: 5,
precision: 1,
stepSize: 18.1,
min: 148.5,
max: 220.9
}
}]
}
}
});