Gradient under line chart

1,568 views
Skip to first unread message

ley.c...@gmail.com

unread,
Dec 27, 2014, 11:04:01 AM12/27/14
to c3...@googlegroups.com
Is there a way to have the area under a line chart to be filled with a gradient? For example like in this chart:

https://camo.githubusercontent.com/8e615d1add6262c57b437e2b21df9bd13c8674f8/687474703a2f2f692e737461636b2e696d6775722e636f6d2f695543434d2e6a7067

Thanks!

Ben Drechsel

unread,
Feb 5, 2015, 7:43:25 PM2/5/15
to c3...@googlegroups.com, ley.c...@gmail.com
I have this on my list of things to try, I'll check back in once I've tested it - might be as easy as applying a CSS gradient to the .c3-area class...

Ben Drechsel

unread,
Feb 5, 2015, 8:34:34 PM2/5/15
to c3...@googlegroups.com, ley.c...@gmail.com
Nope, it's not that easy - the gradient must be defined within the SVG, CSS gradients don't work (yet).

Ben Drechsel

unread,
Feb 6, 2015, 5:32:47 PM2/6/15
to c3...@googlegroups.com, ley.c...@gmail.com

c3 supports basic fills by setting the data type to "area" or "area-spline": 

To customize the colors used by your data:

Clemens Ley

unread,
Feb 8, 2015, 12:55:13 PM2/8/15
to Ben Drechsel, c3...@googlegroups.com
Great, thanks a lot.
Reply all
Reply to author
Forward
0 new messages