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

Add arc.label.format option

parent c91efd94
...@@ -122,6 +122,9 @@ ...@@ -122,6 +122,9 @@
__point_onselected = getConfig(['point', 'onselected'], function () {}), __point_onselected = getConfig(['point', 'onselected'], function () {}),
__point_onunselected = getConfig(['point', 'onunselected'], 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 // region - region to change style
var __regions = getConfig(['regions'], []); var __regions = getConfig(['regions'], []);
...@@ -441,7 +444,7 @@ ...@@ -441,7 +444,7 @@
} }
function textForArcLable(d) { function textForArcLable(d) {
var ratio = 100 * (d.endAngle - d.startAngle) / (Math.PI * 2); var ratio = 100 * (d.endAngle - d.startAngle) / (Math.PI * 2);
return ratio.toFixed(1) + "%"; return __arc_label_fomat(d, ratio);
} }
function expandArc(targetId, withoutFadeOut) { function expandArc(targetId, withoutFadeOut) {
var target = svg.selectAll('.chart-arc.target' + (targetId ? '-' + targetId : '')), var target = svg.selectAll('.chart-arc.target' + (targetId ? '-' + targetId : '')),
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
// ["versicolor", 40], // ["versicolor", 40],
// ["virginica", 50], // ["virginica", 50],
], ],
// type : 'pie',
type : 'dount', type : 'dount',
}, },
axis: { axis: {
...@@ -35,6 +36,11 @@ ...@@ -35,6 +36,11 @@
y: { y: {
label: 'Petal.Width' label: 'Petal.Width'
} }
},
arc: {
label: {
format: function (d, ratio) { return ""; }
}
} }
}); });
......
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