echarts icon indicating copy to clipboard operation
echarts copied to clipboard

饼图tooltip-formatter异常

Open feynmx opened this issue 8 years ago • 1 comments

One-line summary [问题简述]

饼图使用dataset后,tooltip-formatter设置字符串模板出现问题 image

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.0
  • Browser version [浏览器类型和版本]: Chrome 64
  • OS Version [操作系统类型和版本]: Win10

Expected behaviour [期望结果]

image

ECharts option [ECharts配置项]

option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {@2012} ({d}%)"
    },
    dataset: {
        source: [
            ['product', '2012'],
            ['直接访问', 335],
            ['邮件营销', 310],
            ['联盟广告', 234],
            ['视频广告', 135],
            ['搜索引擎', 1548]
        ]
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series: [
        {
            name:'访问来源',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            encode: {
                itemName: 'product',
                value: '2012'
            },
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            }
        }
    ]
}

Other comments [其他信息]

feynmx avatar Feb 05 '18 09:02 feynmx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 01 '20 23:04 stale[bot]