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

柱状图的markArea属性通过x和y设置标记区域报错 #7055

Closed
xiaobao66 opened this issue Nov 16, 2017 · 4 comments
Closed

柱状图的markArea属性通过x和y设置标记区域报错 #7055

xiaobao66 opened this issue Nov 16, 2017 · 4 comments
Labels
stale Inactive for a long time. Will be closed in 7 days.

Comments

@xiaobao66
Copy link

xiaobao66 commented Nov 16, 2017

One-line summary [问题简述]

当在柱状图通过markArea属性设置绘制区域时,如果通过x和y属性设置绘制面积,程序会报错,提示Cannot read property '0' of undefined
at markAreaTransform (MarkAreaView.js:23)

Version & Environment [版本及环境]

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

Expected behaviour [期望结果]

能够通过x和y属性绘制标记区域

ECharts option [ECharts配置项]

option = {
    title: {
        show: true,
        text: 'echarts demo'
    },
    legend: {
        show: true,
        formatter: function(item) {
            return `${item}`
        },
        data: [{
            name: '访问量'
        }]
    },
    grid: {
        show: true
    },
    xAxis: {
        type: 'category',
        boundaryGap: true,
        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    },
    yAxis: {
        type: 'value',
        axisLabel: {
            formatter: '{value}'
        }
    },
    tooltip: {
        show: true,
        trigger: 'axis'
    },
    toolbox: {
        show: true,
        feature: {
            saveAsImage: {}
        }
    },
    series: [{
        name: '访问量',
        type: 'bar',
        data: [10, 52, 200, 334, 390, 330, 220],
        markArea: {
            label: {
                normal: {
                    show: true
                }
            },
            data: [
                [{
                    name: 'set a area',
                    x: 50,
                    y: 100
                }, {
                    x: 80,
                    y: 200
                }]
            ]
        }
    }]
}

Other comments [其他信息]

https://jsfiddle.net/xiaobao/97nm56yg/
可以查看控制台,上面有报错信息

@xiaobao66 xiaobao66 changed the title 饼图的markArea属性通过x和y设置标记区域报错 柱状图的markArea属性通过x和y设置标记区域报错 Nov 16, 2017
@marcong95
Copy link

遇到同类问题,关注。。。

@ctc1995
Copy link

ctc1995 commented Mar 8, 2019

有进一步解决方案吗?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2021

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Sep 4, 2021
@github-actions
Copy link
Contributor

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive for a long time. Will be closed in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants