echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Echarts中折线图上数值可以有个按钮点击自动隐藏或显示吗?

Open wangyahua opened this issue 9 years ago • 2 comments

One-line summary [问题简述]

折线图上 每个点都有数值显示 有个按钮 可以切换显示或者隐藏折线上的数值

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:最新
  • Browser version [浏览器类型和版本]:chrome
  • OS Version [操作系统类型和版本]:Linux

Expected behaviour [期望结果]

可以有个按钮 点击切换显示或隐藏折线图上的数值

ECharts option [ECharts配置项]

option = {
 title: {
        text: '对数轴示例',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c}'
    },
    legend: {
        left: 'left',
        data: ['2的指数', '3的指数']
    },
    xAxis: {
        type: 'category',
        name: 'x',
        splitLine: {show: false},
        data: ['一', '二', '三', '四', '五', '六', '七', '八', '九']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    yAxis: {
        type: 'log',
        name: 'y'
    },
    series: [
        {
            name: '3的指数',
            type: 'line',
            data: [1, 3, 9, 27, 81, 247, 741, 2223, 6669],
            label: {
                    normal: {
                        show: true,
                        position: 'top',
                        formatter: '{c}',
                    },

                }
        },
        {
            name: '2的指数',
            type: 'line',
            data: [1, 2, 4, 8, 16, 32, 64, 128, 256],
             label: {
                    normal: {
                        show: true,
                        position: 'top',
                        formatter: '{c}',
                    },

                }
        }
    ]
}

Other comments [其他信息]

image

wangyahua avatar Aug 22 '17 04:08 wangyahua

用一般的 HTML 按钮呗~

Ovilia avatar Sep 01 '17 09:09 Ovilia

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 02 '20 20:04 stale[bot]