I am using combo chart using chart.js in my website.
The problem I am facing is the line disappears when it meets the bar. I think it is because the line chart is showing below the bar chart.
PFB the code I used.
var PCTCtx = document.getElementById("pctdiv").getContext("2d");
PCTChart = new Chart(PCTCtx, {
type: 'bar',
data: {
datasets: [{
label: 'Bar Dataset',
data: [100, 70, 60, 40],
backgroundColor: ['red', 'red', 'red', 'red']
}, {
label: 'Line Dataset',
data: [50, 50, 50, 50],
fill: false,
backgroundColor: ['#000000', '#000000', '#000000', '#000000'],
// Changes this dataset to become a line
type: 'line'
}],
labels: ['January', 'February', 'March', 'April']
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
},
gridLines: {
display: false
}
}],
xAxes: [{
barThickness: 35,
gridLines: {
display: false
}
}]
}
}
});
PCTChart.data.datasets[1].borderColor = '#000000';
PCTChart.update();
I need the line to show on the bar chart.
I have created a jsfiddle for the same here
Any help would be appreciable.