Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

How to apply gradient on the opposite side of the Line chart?

Open nikmace opened this issue 1 year ago • 1 comments

Feature Proposal

I can only apply the gradient below the line.

Currently the Line chart looks like this: Screenshot 2024-05-19 at 14 33 49

What is the expected behavior?

The gradient appears on the opposite side of the line, meaning from the line to the top of the chart.

And I want to make the gradient like this: (so it appears where I have drawn white lines, so it is inverted in relation to the line) Screenshot 2024-05-19 at 14 34 11

Possible Implementation

No response

nikmace avatar May 19 '24 11:05 nikmace

You can specify the fill as an object and set the above property: https://www.chartjs.org/docs/4.4.3/charts/area.html#example-with-multiple-colors

LeeLenaleee avatar May 19 '24 16:05 LeeLenaleee