mrjoh3 / c3

c3 HTMLWidget Ploting
39 stars 51 forks source link

legend label turns to 0 in pie/donut chart with only one category #3

Closed zhiboz closed 8 years ago

zhiboz commented 8 years ago

the legend label turns to '0' in pie/donut charts with only one category, see the sample code below.

data.frame(red=82) %>% 
  c3() %>% 
  c3_pie()
data.frame(red=82) %>% 
  c3() %>% 
  c3_donut()
mrjoh3 commented 8 years ago

hi @zhiboz, I had not considered such a use case but the single value broke the R to js data structure translation. This should now be resolved but please check and advise if you have any problems.

zhiboz commented 8 years ago

it works beautifully now. thanks a ton!