There are times when my system receives nulls or undefined. I need that when I have null or undefined data the union between these points is traced with a line of another color.
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [
{
fill: false,
label: 'test',
data: [22, 29, 33,undefined, 55, 52, 33],
backgroundColor:'rgba(255, 99, 132, 1)',
borderColor: "red",
borderWidth: 2
}
]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js"></script>
<canvas id="myChart" width="800" height="500"></canvas>
Jsfiddle link