terezka/line-charts

Allow Gradients or Dynamic Line Colors

Closed this issue · 4 comments

In order to produce effects like:

screen shot 2017-12-04 at 19 57 19

Here github's project activity charts, we have to have control of the line's/area's color a bit more.

Have you considered making the color (x,y) dependent function:

color : (Float, Float) -> Color

or maybe simply allowing a gradient between max and min of the axis.

Sounds reasonable! Thanks for letting me know. Think that might actually change some things 😬

Not sure the (x,y) -> Color is super useful (at least for me). I was able to get the desired effect by including a linearGradient (hard-coded) in defs and setting the stroke of interpolation__line to that.

Here is the result, bask in its gloriousness:

screen shot 2017-12-06 at 19 42 20

My current idea is to set the gradient between min and max, but I haven't tried to implement anything yet since I'm focusing on the date time axes. I'll get back to you if I have any questions when I start working on it. :)