hey,
I am stuck with this problem.
I want the plotted region below the limit colored in green
This is my sandbox url Chart.js Sandbox Editor
help me out please!
hey,
I am stuck with this problem.
I want the plotted region below the limit colored in green
This is my sandbox url Chart.js Sandbox Editor
help me out please!
Hi @kaavya,
To do this you would add a box annotation that colors the region below the line annotation:
{
type: 'box',
xScaleID: 'x',
yScaleID: 'y',
xMin: 0,
xMax: 31,
yMin: 0,
yMax: 8000,
backgroundColor: 'rgba(0, 255, 0, 0.1)',
},
i think the question is misunderstood. i want to replicate this
where i want the plotted region until the limit is filled in green
It’s not pretty, but one way to do this is by splitting it into two series, one below the target and one above.
I think this approach does not work because the graph is discontinued at the point below the limit and if the gap between the points above and below the limit is large, the graph breaks
do we have any other possible ways to do it without making it into 2 datasets?
because calculating the point that intersects with the limit is not practical.