提交 f7953cb0 编写于 作者: C Catouse

* add id attribute to segment.

上级 27762aae
......@@ -138,6 +138,7 @@
var index = atIndex || this.segments.length;
this.segments.splice(index, 0, new this.SegmentArc(
{
id: typeof segment.id === 'undefined' ? index : segment.id,
value: segment.value,
outerRadius: (this.options.animateScale) ? 0 : this.outerRadius,
innerRadius: (this.options.animateScale) ? 0 : (this.outerRadius / 100) * this.options.percentageInnerCutout,
......@@ -226,7 +227,7 @@
var x = Math.cos(middleAngle) * segment.outerRadius,
y = Math.sin(middleAngle) * segment.outerRadius,
text = helpers.template(options.scaleLabel, {value: typeof easeDecimal === 'undefined' ? segment.value : Math.round(easeDecimal * segment.value)});
text = helpers.template(options.scaleLabel, {value: typeof easeDecimal === 'undefined' ? segment.value : Math.round(easeDecimal * segment.value), label: segment.label});
var ctx = this.chart.ctx;
ctx.font = helpers.fontString(options.scaleFontSize, options.scaleFontStyle, options.scaleFontFamily);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册