victory icon indicating copy to clipboard operation
victory copied to clipboard

VictoryLine gradient

Open icd2k3 opened this issue 9 years ago • 3 comments

Hey there - loving this project!

So far it has hit all my use cases... except one. I have a design requirement for a single line graph where the path changes color based on the current position

ex: highest points of the graph would be green and lowest would be red.

Closest example I could find of what I'm going for outlined here gradient-line

I couldn't find anything about this in the docs so I'm assuming this is a feature request.

Thanks!

icd2k3 avatar Apr 30 '17 00:04 icd2k3

I'm sure someone else can come up with something better but have a look at this JSFiddle for some ideas.

joshuahenson avatar Apr 30 '17 07:04 joshuahenson

@joshuahenson this is perfect - thanks so much for your help! Closing this issue

icd2k3 avatar Apr 30 '17 15:04 icd2k3

This is awesome--thanks, @joshuahenson, @icd2k3!

One small note to anyone else referencing this ticket: since a stroked horizontal line has no height, a linearGradient using objectBoundingBox geometry (default) won't render. If your dataset may include flat values, consider setting gradientAttributes='userSpaceOnUse' instead.

rjz avatar May 22 '17 15:05 rjz