I am creating a linechart, with months on the x axis and values on the y axis. The issue is that when there is a single data point, there is no line drawn around it. I was able to draw a horizontal line using the annotations plugin but when the value is > 0 i dont know how to draw a line then, since it is supposed to be a curve.
export const optionsMap = () => ({
maintainAspectRatio: false,
responsive: true,
legend: {
display: false
},
elements: {
topLabel: {}
},
layout: {
padding: {
top: 150,
right: 45,
left: 40,
bottom: 5,
}
},
plugins: {
centerText: false,
datalabels: false,
},
annotation: {
drawTime: 'beforeDatasetsDraw',
annotations: [
{
type: 'line',
scaleID: 'y-axis-0',
value: 0.01,
mode: "horizontal",
borderColor: "#347aeb",
borderWidth: 2,
backgroundColor: "rgba(255, 0, 0, 0.3)"
}
]
}
});