Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line.markArea.label.normal.show为false时,依然显示label #4723

Closed
zhoujiamin opened this issue Dec 19, 2016 · 1 comment
Closed

line.markArea.label.normal.show为false时,依然显示label #4723

zhoujiamin opened this issue Dec 19, 2016 · 1 comment
Labels

Comments

@zhoujiamin
Copy link

One-line summary [问题简述]

想把markArea的label去除,但markArea.label.normal.show设置为false时,label还是会存在。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:"version": "3.3.2",
  • Browser version [浏览器类型和版本]:chrome 55
  • OS Version [操作系统类型和版本]:win7

Expected behaviour [期望结果]

希望markArea的label(就是图上方的文字)去除

ECharts option [ECharts配置项]

option = {
    title: {
        text: '一天用电量分布',
        subtext: '纯属虚构'
    },
    tooltip: {
        trigger: 'axis'
    },
    toolbox: {
        show: true,
        feature: {
            saveAsImage: {}
        }
    },
    xAxis:  {
        type: 'category',
        boundaryGap: false,
        data: ['00:00', '01:15', '02:30', '03:45', '05:00', '06:15', '07:30', '08:45', '10:00', '11:15', '12:30', '13:45', '15:00', '16:15', '17:30', '18:45', '20:00', '21:15', '22:30', '23:45']
    },
    yAxis: {
        type: 'value',
        axisLabel: {
            formatter: '{value} W'
        }
    },
    visualMap: {
        show: false,
        dimension: 0,
        pieces: [{
            lte: 6,
            color: 'green'
        }, {
            gt: 6,
            lte: 8,
            color: 'red'
        }, {
            gt: 8,
            lte: 14,
            color: 'green'
        }, {
            gt: 14,
            lte: 17,
            color: 'red'
        }, {
            gt: 17,
            color: 'green'
        }]
    },
    series: [
        {
            name:'用电量',
            type:'line',
            smooth: true,
            data: [300, 280, 250, 260, 270, 300, 550, 500, 400, 390, 380, 390, 400, 500, 600, 750, 800, 700, 600, 400],
            markArea: {
                itemStyle:{
                    normal:{
                       color:'rgba(208, 208, 208,0.3)'
                    }
                },
                label:{
                    normal:{
                         show:false,
                         textStyle:{
                             color: "#000", 
                             fontStyle:'italic'
                         }
                    },
                    emphasis:{
                        show:true, 
                        position: 'top'
                    }
                   
                },
                data: [ [{
                    name: '早高峰',
                    xAxis: '07:30'
                }, {
                    xAxis: '10:00'
                }], [{
                    name: '晚高峰',
                    xAxis: '17:30'
                }, {
                    xAxis: '21:15'
                }] ]
            }
        }
    ]
};

Other comments [其他信息]

@maskTAQ
Copy link

maskTAQ commented Dec 21, 2016

我也遇到了这种问题,你可以考虑用定位间接隐藏,比如 label.normal.position=["100%",""]。

@pissang pissang added the bug label Dec 21, 2016
@100pah 100pah closed this as completed in 253bf28 Dec 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants