jettro / c3-angular-directive

Contains angularjs directives that use c3js to create good looking graphs
http://jettro.github.io/c3-angular-directive/
MIT License
203 stars 98 forks source link

Donut and Pie chart column colors use the last value only #86

Closed shahinlotfi closed 8 years ago

shahinlotfi commented 8 years ago

There seems to be a bug where the color pattern values don't work for donut charts. The legend shows the correct colors, but the donut pieces all use the last color value in the pattern. The same goes for pie charts.

anukiransolur commented 8 years ago

I am facing the same issue too. Is there any other way to customize donut chart colors ??

simonstewart commented 8 years ago

Having a similar issue with wanting to specify chart colors.

I'm using the directive in this way:

As I'm wanting to display a separate legend, I need to specify the colors up front.

anukiransolur commented 8 years ago

Thanks for the reply @simonstewart . But I cant see the code because it is blank in the message.

simonstewart commented 8 years ago

@anukiransolur, here is is

`

            <chart-legend show-legend="false" />
            <chart-donut expand="true" width="40" show-label="false" title="" />
        </c3chart>`

I have tried to use the chart-colors element with a list of hex colors, but only the last color in the list is used. Have also implemented the color-function, which gets called for each segment of the pie, but I can't seem to return a new color.

I need to be able to provide a list of colors to the chart, so I can build a separate legend with matching colors.

anukiransolur commented 8 years ago

@simonstewart the color function does not work. Its a bug and someone has to fix it.

jettro commented 8 years ago

It is fixed in the master and will be included in release 1.1

simonstewart commented 8 years ago

Thanks @jettro. Seems to be fixed now. Much appreciated.