2016-02-29 69 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