鍍金池/ 問(wèn)答/HTML5  HTML/ echarts pie餅圖如何默認(rèn)懸浮

echarts pie餅圖如何默認(rèn)懸浮

clipboard.png

如何讓echarts的餅圖初始化就顯示這種懸浮的效果,
現(xiàn)在只能鼠標(biāo)移上去才有效果。
有沒(méi)有個(gè)配置項(xiàng)呢?求教各位大神!急!

加了一個(gè)配置項(xiàng)
selected:true
會(huì)出現(xiàn)下面的情況

clipboard.png

回答
編輯回答
硬扛

+1 遇到過(guò)同樣的問(wèn)題 沒(méi)有解決。。。

2017年9月20日 17:11
編輯回答
刮刮樂(lè)

Echarts3里有很好的例子,當(dāng)然是使用事件,點(diǎn)這里

加上這幾個(gè)你試試

myChart.dispatchAction({
    type: 'downplay',
    seriesIndex: 0,
    dataIndex: 0
});
myChart.dispatchAction({
    type: 'highlight',
    seriesIndex: 0,
    dataIndex: 0
});
myChart.dispatchAction({
    type: 'showTip',
    seriesIndex: 0,
    dataIndex: 0
});
2017年7月5日 01:55
編輯回答
葬愛(ài)

data:[

            {value:335, name:'直達(dá)', selected:true},
            {value:679, name:'營(yíng)銷廣告'},
            {value:1548, name:'搜索引擎'}
        ]
        

echarts上有個(gè)例子可以看下.

2018年7月10日 12:26
編輯回答
乖乖瀦

我想知道這種效果是怎么做的,方便教我一下嗎

2017年1月22日 08:27
編輯回答
忘了我

請(qǐng)問(wèn)解決了嗎?我也需要這種效果...

2017年3月31日 21:28
編輯回答
生性

請(qǐng)問(wèn)解決了嗎,我也遇到了這樣的問(wèn)題

2017年8月18日 06:30
編輯回答
喵小咪
            let currentIndex = 0;
            setTimeout(function() {
                currentIndex--;
                var dataLen = gradeOption.series[0].data.length;
                // 取消之前高亮的圖形
                gradeEchart.dispatchAction({
                    type: 'downplay',
                    seriesIndex: 0,
                    dataIndex: currentIndex
                });
                currentIndex = (currentIndex + 1) % dataLen;
                // 高亮當(dāng)前圖形
                gradeEchart.dispatchAction({
                    type: 'highlight',
                    seriesIndex: 0,
                    dataIndex: currentIndex
                });
            }, 100);
            $("#showEchart").mouseenter(function() {
                gradeEchart.dispatchAction({
                    type: 'downplay',
                    seriesIndex: 0,
                    dataIndex: currentIndex
                });
            });
            $("#showEchart").mouseleave(function() {
                gradeEchart.dispatchAction({
                    type: 'highlight',
                    seriesIndex: 0,
                    dataIndex: currentIndex
                });
            });

寫在option后面 gradeOption即你定義的option

2017年1月27日 13:18