Fill gradient color in area under line chart with Protovis 3.2

101 views
Skip to first unread message

Huy Dinh

unread,
Sep 28, 2011, 8:02:47 AM9/28/11
to protovis
I want to fill gradient color in area under line chart when I add
area.
I have tried with color functions in Protovis but they do not work.
Is there any solution for that?
Here is my code to add Area into line chart
addArea: ->
self = this
@vis.add(pv.Area)
.data(self.data[0].values)
.bottom(1)
.left((d) -> self.xAxisUnits(d.index))
.height((d) -> self.yAxisUnits(d.value))
.fillStyle(pv.ramp('black', 'red'))
.anchor("top")
.add(pv.Line)
.lineWidth(2)
.strokeStyle("#78B9E2")
this

Mike Bostock

unread,
Sep 28, 2011, 11:21:11 AM9/28/11
to prot...@googlegroups.com
Protovis does not support gradients. You can use D3 instead, which
supports gradients (and any other feature of SVG):

http://bl.ocks.org/1086421

Mike

Huy Đinh

unread,
Sep 28, 2011, 9:53:27 PM9/28/11
to prot...@googlegroups.com
Thanks for your reply.


--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protovis?hl=en.


Reply all
Reply to author
Forward
0 new messages