Rails: Pie Charts legend in Chartkicks -
in highcharts
show percentage along pie_charts
, legend can customized this:
legend: {labelformat: '{name} : {y} ({percentage}%)'}
but in chartkicks
can't find how this?
if @ documentation specified on chartkick gem homepage, says:
you can pass options directly charting library with: <%= line_chart data, library: {backgroundcolor: "#eee"} %>
so in scenario, should try like:
<%= pie_chart data, library: {legend: {labelformat: '{name} : {y} ({percentage}%)'}} %>
Comments
Post a Comment