c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.33k stars 1.39k forks source link

Make charts inherit font size from parent container 1em #2711

Open danjoneslf opened 4 years ago

danjoneslf commented 4 years ago

I'd like to submit a PR to inherit the current font size by evaluating the computed value of 1em from the container (chart.bindto) element.

It's not 100% working yet (So far I have the correct font size being correctly applied to the legend, axis ticks and labels and the labels on bars / arcs ... and the legend tile size. It's also adjusting the legend and axis label positioning) but given your instructions about raising an issue before submitting a PR I thought I'd check before investing any more time in it.

There are some more things I need to do with positioning but the main remaining thing I'd like to do is adjust the axis ticks so the tick labels don't overrun. At the moment this has to be done by specifying the tick values in the chart config.

Let me know what you think.

Thanks. Dan