terezka / line-charts

Archived in favor of terezka/elm-charts.
https://terezka.github.io/line-charts
BSD 3-Clause "New" or "Revised" License
456 stars 45 forks source link

Allow Gradients or Dynamic Line Colors #5

Closed anagrius closed 2 years ago

anagrius commented 6 years ago

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.

terezka commented 6 years ago

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

anagrius commented 6 years ago

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
terezka commented 6 years ago

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. :)

anagrius commented 6 years ago

Thats what I would do too.

On 7 Dec 2017, at 15:03, Tereza Sokol notifications@github.com wrote:

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. :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/terezka/lines/issues/5#issuecomment-349975633, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJmGhrNEj_0aRBF61BcTWV37Vx-Urctks5s9_A8gaJpZM4Q1Jdu.