If you look at the documentation listed on the ChartKick Gem homepage , it says:
You can pass options directly to the charting library with:
<%= line_chart data, library: {backgroundColor: "#eee"} %>
So in your scenario you should try something like:
<%= pie_chart data, library: {legend: {labelFormat: '{name} : {y} ({percentage}%)'}} %>
source
share