Im using chart.js and I have a line chart.I want to add a second line/dataset that starts from where the first line ends.
Ive seen people do this by adding null
in the data
property inside the datasets
like this:
type: "line",
data: {
labels: ["January,"February","March","April","May","June","July","August"],
datasets: [
{
label: "My First Dataset",
data:[4,5,6,7,8],
fill: false,
borderColor: "rgb(75, 192, 192)",
tension: 0.3,
},
{ label: "My First Dataset",
data:[null,null,null,null,null,9,10,11],
fill: false,
borderColor: "rgb(75, 192, 192)",
tension: 0.3,
},
],
},
});
is there a different way to achieve this?