timqian / chart.xkcd

xkcd styled chart lib
https://timqian.com/chart.xkcd/
MIT License
7.61k stars 200 forks source link

innerRadius of 0 for Pie Reverts to Default Radius of 0.5 #15

Closed dm-p closed 4 years ago

dm-p commented 4 years ago

Hi @timqian - as mentioned elsewhere, I'm loving your work! :)

I'm just testing 1.0.7 and observed in the documentation that innerRadius is a valid key in the options object for the Pie chart. I've been testing the functionality and works as expected, with the exception of 0 as a value.

According the to the doc:

Want a pie chart? set innerRadius to 0

This works all the way down to 0.01 and then when set to 0 it reverts the chart back to the default (0.5), so I suspect there might be an evaluation of 0 that is coercing to default. I've attached an example of rendering for a couple of values, but can reproduce in the codepen examples also.

image

shiyiya commented 4 years ago

https://github.com/timqian/chart.xkcd/blob/f2b4546b7d15157695a0dc0ba3b1874438039cfc/src/Pie.js#L69 mybe here

timqian commented 4 years ago

@dm-p @shiyiya Thanks, this issue is fixed in v1.0.8

dm-p commented 4 years ago

Thanks, folks! Working great in 1.0.8!