echarts icon indicating copy to clipboard operation
echarts copied to clipboard

请问itemStyle中的emphasis能关闭吗?

Open R-River opened this issue 10 years ago • 3 comments

问题简述 (One-line summary)

我将label设置在饼图内显示 但是当鼠标移到饼图上时 emphasis触发 会覆盖掉文字 请问有办法关掉emphasis的效果吗?我现在是把normal和emphasis的label都写成一样的 可以保证文字一直显示 可是当文字长度变化时会在下方漏出来。

请问有方法改进吗 谢谢!

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):2.2.7
  • 浏览器类型和版本 (Browser version):chrome/IE8
  • 操作系统类型和版本 (OS Version):win7/10

重现步骤 (Steps to reproduce)

1.将鼠标放在饼图上 2.当timeline使饼图数据变化时 饼图的label有时会在区域下方漏出来

期望结果 (Expected behaviour)

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

option = {
        timeline:{
            show:false,
            type:'number',
            data:['1','2','3'],
            autoPlay : true,
            playInterval : 2000
        },
        options:[
            {
                title : {
                    text: '资产结构变化图',
                    x:'center'
                },
                legend: {
                    data:['流动资产','非流动资产','流动资产比例','非流动资产比例'],
                    x:'center',
                    y:40
                },
                grid:{
                    borderColor:'rgba(0,0,0,0)',
                    x2:100,
                    y:80
                },
                xAxis : [
                    {
                    type : 'category',
                    splitLine:{show:false},
                    axisLabel: {'interval':0},
                    axisLine:{lineStyle:{color:'#000000',width:1}},
                    data : ['本月','上月','去年同期']
                    }
                ],
                yAxis : [
                    {
                        type : 'value',
                        name:'单位:万元',
                        min:0,
                        max:40000,
                        splitNumber:8,
                        axisLine:{lineStyle:{color:'#000000',width:1}}
                    }
                ],
                series : [
                    {
                        name:'流动资产',
                        type:'bar',
                        barWidth:60,
                        stack:'资产',
                        data:[18285,16065,14356]
                    },
                    {
                        name:'非流动资产',
                        type:'bar',
                        stack:'资产',
                        data:[16215,15435,15244]
                    },
                    {
                        name:'本月',
                        type:'pie',

                        center: [520,110],
                        radius : [0, 40],
                        itemStyle : {
                            normal : {
                                label:{show:true,formatter:"{a}\n{c}%",position:'inside',textStyle:{color:'#000000'}},
                                labelLine : {
                                    show:false
                                }
                            },
                            emphasis:{
                                label:{show:true,formatter:"{a}\n{c}%",position:'inside',textStyle:{color:'#000000'}},
                                labelLine : {
                                    show:false
                                }
                            }
                        },
                        data:[
                            {value:53, name:'流动资产比例'},
                            {value:47, name:'非流动资产比例'}
                        ]
                    }
                ]
            },
            {series:
                [
                    {},{},{
                        name:'上月',
                        data:
                        [
                            {value:51, name:'流动资产比例'},
                            {value:49, name:'非流动资产比例'}
                        ]
                    }
                ]
            },
            {series:
                [
                    {},{},{
                        name:'去年同期',
                        data:
                        [
                            {value:48.5, name:'流动资产比例'},
                            {value:51.5, name:'非流动资产比例'}
                        ]
                    }
                ]
            }   
        ]
}

其他信息 (Other comments)

1

R-River avatar Mar 07 '16 02:03 R-River

试一下 3.0

pissang avatar Mar 07 '16 02:03 pissang

@pissang 好的~ 之前都是2.2.7 正在准备升级 前端开发的兄弟们有点忙就一直没着手弄~

R-River avatar Mar 07 '16 03:03 R-River

@pissang 能否设置某个省默认就是 emphasis?

mookilyu avatar May 04 '18 03:05 mookilyu