Chart.js #9084
by Akihiko Kusanagi
HTML
<script src="https://cdn.jsdelivr.net/gh/nagix/nagix.github.io@chartjs/Chart.9082.js"></script>
<div>
<canvas id="myChart" width="512" height="256"></canvas>
</div>
JavaScript
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
data: [{
x: 10,
y: 1
}, {
x: 0,
y: 5
}, {
x: -10,
y: 15
}, {
x: -5,
y: 19
}],
borderColor: 'red',
fill: false,
cubicInterpolationMode: 'monotone'
}]
},
options: {
indexAxis: 'y',
scales: {
x: {
type: 'linear',
min: -15,
max: 15
},
y: {
type: 'linear',
min: 0,
max: 20
}
},
animation: false,
plugins: {
legend: false
}
}
});