有没有办法得到雷达图上标签的坐标?我试着把图片而不是文字放在标签区域。
发布于 2015-07-14 11:07:20
您可以使用scale属性计算它。以下是动画完成后,在这些点画一个蓝色圆圈的东西。
onAnimationComplete: function () {
for (var i = 0; i < this.scale.valuesCount; i++) {
// get the poitn position
var pointLabelPosition = this.scale.getPointPosition(i, this.scale.calculateCenterOffset(this.scale.max) + 5);
// draw a circle at that point
this.chart.ctx.beginPath();
this.chart.ctx.arc(pointLabelPosition.x, pointLabelPosition.y, 5, 0, 2 * Math.PI, false);
this.chart.ctx.fillStyle = '#77e';
this.chart.ctx.fill();
this.chart.ctx.stroke();
}
}小提琴- http://jsfiddle.net/1jgmbyb7/
https://stackoverflow.com/questions/31389733
复制相似问题