Linear Time2
by rough cheap
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.bundle.min.js"></script>
<canvas id="myChart" width="200" height="200"></canvas>
JavaScript
const times = ["1:32.599", "1:32.300", "1:31.000"];
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['1', '2', '3'], // list of races,
datasets: [{
label: "Best Lap",
data: times,
backgroundColor: 'rgba(99, 132, 0, 0.6)',
borderWidth: 0
}]
},
options: {
scales: {
yAxes: [{
type: 'time',
time: {
parser: 'm:s.SSS',
unit: 'seconds',
unitStepSize: 5,
min: '1:0.0',
max: '2:0.0',
displayFormats: {
'seconds': 'm.s'
}
}
}]
}
}
});