controlling donut chart colors with multiple series

5 views
Skip to first unread message

gruf...@googlemail.com

unread,
Aug 26, 2009, 5:46:11 AM8/26/09
to ZiYa Plugin
I'm struggling to change the color of the segments on the donut
chart. I can control the line color of the segments and I can set a
series color but I don't know what (if anything) can change the colors
of the individual segments. Any ideas?

Thanks

Fernand Galiana

unread,
Aug 26, 2009, 10:47:43 AM8/26/09
to ziya-...@googlegroups.com
Hi,

    Don't think there is a way to change the segments color first hand, I'll have to do
    some more research...

    In donuts, the series color will only affect the segment when you have a single series.
    Assuming you have multiple series the series_color will only affect each series ie the
    rings in the donut and not the individual segments. One way, less than ideal, you
    can affect the segment color is to specify a glow (or other) filter on each of
    your segments.

    So something like

    chart.add :series, 'Blee', [
      { :glow => 'fred', :label => 'region A', :line_thickness => '2', :value => 75 },
      ...
    ]

 Where fred is a glow filter specified in the chart stylesheet file

  <%=comp :filter %>
    filters:
      - <%= filter_type :glow %>
          id:            fred
          blurX:       2
          blurY:       2
          strength:   50
          alpha:       30
          inner:      true
          color:       ff0000

-Fernand
Reply all
Reply to author
Forward
0 new messages