frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

Use a linear gradient as line color #419

Open Weasy666 opened 6 months ago

Weasy666 commented 6 months ago

I would like to be able to use a linear gradient as color for a line in the line graph, so that the line looks like this image

I have looked through the docs and Github issues, but it looks like one can only set a color for a line and set lineOptions.heatline = true to get a fading effect on the line.

I tried to somehow hack the chart and replace the stops of the linearGradient in the svg's defs, but that just breaks the chart and nothing is rendered anymore, or it seems to be just getting replaced again from the chart rendering code.

Is there a way to do this, which i have missed?