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只在x轴为value类型时可以正常显示 #7990

Open
lxyctl opened this Issue Mar 22, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@lxyctl

lxyctl commented Mar 22, 2018

One-line summary [问题简述]

line的markarea只在x轴为value类型时可以正常显示
官网示例已经挂了:http://echarts.baidu.com/examples/editor.html?c=line-sections
4.0.4有问题,3.8.5正常

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:4.0.4
  • Browser version [浏览器类型和版本]:Chrome 版本 65.0.3325.181(正式版本) (64 位)
  • OS Version [操作系统类型和版本]:Windows Server 2016

Expected behaviour [期望结果]

line的x轴为任何类型时markarea都应该可以正常显示

ECharts option [ECharts配置项]

option = {
    title: {
        text: '一天用电量分布',
        subtext: '纯属虚构'
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross'
        }
    },
    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'
        },
        axisPointer: {
            snap: true
        }
    },
    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: {
                data: [ [{
                    name: '早高峰',
                    xAxis: '07:30'
                }, {
                    xAxis: '10:00'
                }], [{
                    name: '晚高峰',
                    xAxis: '17:30'
                }, {
                    xAxis: '21:15'
                }] ]
            }
        }
    ]
}

Other comments [其他信息]

@yanq87

This comment has been minimized.

yanq87 commented Apr 12, 2018

用序号可以的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment