2016-02-29 67 views
0

每个饼图弧内的标签位于边缘。我想使用css(.c3-arcs文本选择器)使文本更大,但文本被截断。有没有办法让标签在每个圆弧内居中?如何在C3.js饼图中居中放置标签

这里有一个jsbin demo

enter image description here enter image description here

+0

因为它们在SVG平局内再现这将是棘手的实际用CSS来操纵...... – Pogrindis

+0

@Pogrindis是否有除了CSS的另一种方式?我一直在阅读他们的文档,但无法找到任何修改这些位置的选项。 – Jerry

+0

似乎他们使用'd3.format()'方法,但似乎没有任何'开箱即用'的解决方案来解决你的问题。 – Pogrindis

回答

0

同事想出了用text-anchor的解决方案,这是不完美的,但移动标签接近中心。

enter image description here

.c3-chart-arcs text { 
    text-anchor: start !important; 
} 

.c3-target-Large text { 
    text-anchor: end !important; 
} 

更新jsbin