Rails:使用Chartkick Gem从饼图中删除白色边框 [英] Rails: Remove white border from Pie Chart using Chartkick Gem
本文介绍了Rails:使用Chartkick Gem从饼图中删除白色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过向库中添加选项来删除饼图切片中的白色边框?
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'}} %>
提前谢谢!
推荐答案
尝试将borderWidth
选项设置为0
:
<%= pie_chart monthly(current_user.events), colors: colors_group, width: "200px", height: "200px", library: {animation: {easing: 'easeOutQuad'}, elements: {arc: {borderWidth: 0}}} %>
您可以在其上找到Chart.js元素配置的更多选项.文档页面.
希望这会有所帮助!
这篇关于Rails:使用Chartkick Gem从饼图中删除白色边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文