Groups
Groups
Sign in
Groups
Groups
c3js
Conversations
Labels
About
Send feedback
Help
Gradient under line chart
1,568 views
Skip to first unread message
ley.c...@gmail.com
unread,
Dec 27, 2014, 11:04:01 AM
12/27/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
2/5/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
2/5/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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).
http://stackoverflow.com/questions/13760299/dynamic-svg-linear-gradient-when-using-javascript
Ben Drechsel
unread,
Feb 6, 2015, 5:32:47 PM
2/6/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to c3...@googlegroups.com, ley.c...@gmail.com
c3 supports basic fills by setting the data type to "area" or "area-spline":
http://c3js.org/samples/chart_area.html
To customize the colors used by your data:
http://c3js.org/reference.html#data-colors
Clemens Ley
unread,
Feb 8, 2015, 12:55:13 PM
2/8/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ben Drechsel, c3...@googlegroups.com
Great, thanks a lot.
Reply all
Reply to author
Forward
0 new messages