feral-dot-io / leptos-chartistry

Chartistry is an extensible charting library for Leptos
https://feral-dot-io.github.io/leptos-chartistry/
Mozilla Public License 2.0
69 stars 6 forks source link

Allow anchoring gradients to Y values #19

Open Panaetius opened 5 months ago

Panaetius commented 5 months ago

For color gradients, it would be nice if we could say what Y-axis value corresponds to 0% or 100%, so there can be fixed colors for specific values even if the chart range is different.

For example, if I have two charts side by side, one goes from 50 to 150 and the other goes from 0 to 100, but I want e.g. 88 to have the same color value in both of them. Right now you'd have to dynamically create gradients for each chart based on their range, and recalculate them every time the series signal changes.

feral-dot-io commented 5 months ago

This is a good idea, thank you for the use case.

I think I wrote gradients with this is mind so I'll take a look at implementing it.