问题
Is there a way to remove the white border from the pie chart slices by adding an option to the library?
I've got a snippet of the code I used to create this chart.
<%= pie_chart monthly(current_user.events), colors: colors_group, width: "200px", height: "200px", library:{animation:{easing: 'easeOutQuad'}} %>
Thank you in advance!
回答1:
Try setting the borderWidth
option to 0
:
<%= pie_chart monthly(current_user.events), colors: colors_group, width: "200px", height: "200px", library: {animation: {easing: 'easeOutQuad'}, elements: {arc: {borderWidth: 0}}} %>
You can find more options for Chart.js element configuration on their docs page.
Hope this helps!
来源:https://stackoverflow.com/questions/47916211/rails-remove-white-border-from-pie-chart-using-chartkick-gem