我怎么能在黄色部分写一些文字,只有当我点击这部分时才能看到这个? http://jsfiddle.net/r6p7E/14/
mouseOut: function () {
var serie = this.points;
$.each(serie, function (i, e) {
if (!this.selected) {
this.graphic.attr({
fill: '#242c4a'
});
}
else {
this.graphic.attr({
fill: '#fefe0f',
});
}
});
}`
答案 0 :(得分:0)
您可以捕获SVG元素上的click事件(如圆圈)并按渲染器添加文本。
chart.renderer.circle(175, 216, 22).attr({
fill: '#e7e620',
'stroke-width': 5,
zIndex: 3
})
.on('click', function () {
var text = chart.renderer.text('text', 100, 100)
.attr({
zIndex: 5
})
.css({
color: 'red',
fontSize:'20px'
})
.add();
})
.add();
});