1๐
โ
If you use a scatter plot, it can be done.
See example below:
var scatterChart = new Chart(
document.getElementById('c').getContext('2d'),
{
type: 'scatter',
data: {
datasets: [{
label: 'Scatter Dataset',
data: [{
x: 0,
y: 0
}, {
x: 1,
y: 1
}, {
x: 2,
y: 2
}, {
x: 2,
y: 1
}, {
x: 3,
y: 1
}
],
tension: 0,
showLine: true,
fill:false
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'top'
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
<canvas id="c" width="200" height="200"></canvas>