Chart.js #4696
by Akihiko Kusanagi
HTML
<script src="https://rawgit.com/nagix/nagix.github.io/chartjs/Chart.4697.js"></script>
<canvas id="myChart1"></canvas>
<canvas id="myChart2"></canvas>
JavaScript
var ctx1 = document.getElementById('myChart1').getContext('2d');
var chart1 = new Chart(ctx1, {
type: 'line',
data: {
labels: [0,1,2,3],
datasets: [{
data: [0,1,2,3],
fill: '+1',
steppedLine: 'before'
}, {
data: [2,3,4,5],
fill: false,
steppedLine: 'before'
}]
},
options: {
title: {
display: true,
text: '1. steppedLine: \'before\''
},
scales: {
xAxes: [
],
yAxes: [{
ticks: {
beginAtZero: true,
stepSize: 1
}
}]
}
}
});
var ctx2 = document.getElementById('myChart2').getContext('2d');
var chart2 = new Chart(ctx2, {
type: 'line',
data: {
labels: [0,1,2,3],
datasets: [{
data: [0,1,2,3],
fill: '+1',
steppedLine: 'after'
}, {
data: [2,3,4,5],
fill: false,
steppedLine: 'after'
}]
},
options: {
title: {
display: true,
text: '2. steppedLine: \'after\''
},
scales: {
xAxes: [
],
yAxes: [{
ticks: {
beginAtZero: true,
stepSize: 1
}
}]
}
}
});