0

我怎样才能在黄色部分写一些文字,只有当我点击这部分时才能看到?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',

                                });
                            }
                        });
                    }`
4

1 回答 1

0

您可以在 SVG 元素(如圆圈)上捕获点击事件并通过渲染器添加文本。

http://jsfiddle.net/r6p7E/15/

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();
});
于 2013-08-23T09:52:06.617 回答