Can someone help me figure out how to fill the area between two line graphs using chartjs? I know how to do it when one line is on top of the other, but I'm struggling with getting the area between two lines that are side by side.
For example, I'd like to achieve something similar to this graph:
Here's the code snippet I've been working with:
const ctx = document.getElementById('myChart');
const myChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
label: 'line 1',
data:[
{x: -11, y: 7},
{x: -11, y: 7},
{x: -1, y: 8},
],
showLine: true,
borderColor: '#009999',
backgroundColor: '#009999',
},
{
label: 'line 2',
data: [
{x: 0, y: 7},
{x: 0, y: 7},
{x: 8, y: 8},
],
showLine: true,
borderColor: '#f00',
backgroundColor: '#f00',
}
]
},
options: {
responsive: false,
}
});