ChartJS Line Chart
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.js"></script>
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
</body>
CSS
canvas { background-color : #eee;
}
JavaScript
var options = {
type: 'scatter',
data: {
datasets: [{
data: [{
x: 20,
y: 1
},
{
x: 21,
y: 1.1
},
{
x: 23,
y: 1.4
},
],
}]
},
options: {
legend: false,
scales: {
yAxes: [{
ticks: {
min: 1,
max: 2,
display: false,
},
gridLines: {
color: 'transparent',
display: true,
zeroLineColor: 'red'
},
}],
xAxes: [{
ticks: {
min: 1,
max: 99,
},
gridLines: {
color: 'transparent',
display: true,
zeroLineColor: 'red'
},
}]
}
}
}
var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);