Commit 4a6304c4 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add arc.label.format option

parent c91efd94
......@@ -122,6 +122,9 @@
__point_onselected = getConfig(['point', 'onselected'], function () {}),
__point_onunselected = getConfig(['point', 'onunselected'], function () {});
// arc
var __arc_label_fomat = getConfig(['arc', 'label', 'format'], function (d, ratio) { return ratio.toFixed(1) + "%"; });
// region - region to change style
var __regions = getConfig(['regions'], []);
......@@ -441,7 +444,7 @@
}
function textForArcLable(d) {
var ratio = 100 * (d.endAngle - d.startAngle) / (Math.PI * 2);
return ratio.toFixed(1) + "%";
return __arc_label_fomat(d, ratio);
}
function expandArc(targetId, withoutFadeOut) {
var target = svg.selectAll('.chart-arc.target' + (targetId ? '-' + targetId : '')),
......
......@@ -26,6 +26,7 @@
// ["versicolor", 40],
// ["virginica", 50],
],
// type : 'pie',
type : 'dount',
},
axis: {
......@@ -35,7 +36,12 @@
y: {
label: 'Petal.Width'
}
}
},
arc: {
label: {
format: function (d, ratio) { return ""; }
}
}
});
setTimeout(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment