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

绘制如http://echarts.baidu.com/demo.html#line-aqi 的图形时,如果我的值都一样时,js报错 #3582

Closed
meizi0828 opened this issue Jul 8, 2016 · 0 comments
Labels

Comments

@meizi0828
Copy link

问题简述 (One-line summary)

绘制如http://echarts.baidu.com/demo.html#line-aqi 的图形时,如果我的值都一样时,js报错!

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.0
  • 浏览器类型和版本 (Browser version):Chrome 51.0.2704.103 m
  • 操作系统类型和版本 (OS Version):win 10

重现步骤 (Steps to reproduce)

1.把http://echarts.baidu.com/demo.html#line-aqi例子中的option的series的data修改为 return 200;
2.点击运行

期望结果 (Expected behaviour)

能正确绘制图表

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

$.get('data/asset/data/aqi-beijing.json', function (data) {
    myChart.setOption(option = {
        title: {
            text: 'Beijing AQI'
        },
        tooltip: {
            trigger: 'axis'
        },
        xAxis: {
            data: data.map(function (item) {
                return item[0];
            })
        },
        yAxis: {
            splitLine: {
                show: false
            }
        },
        toolbox: {
            left: 'center',
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                restore: {},
                saveAsImage: {}
            }
        },
        dataZoom: [{
            startValue: '2014-06-01'
        }, {
            type: 'inside'
        }],
        visualMap: {
            top: 10,
            right: 10,
            pieces: [{
                gt: 0,
                lte: 50,
                color: '#096'
            }, {
                gt: 50,
                lte: 100,
                color: '#ffde33'
            }, {
                gt: 100,
                lte: 150,
                color: '#ff9933'
            }, {
                gt: 150,
                lte: 200,
                color: '#cc0033'
            }, {
                gt: 200,
                lte: 300,
                color: '#660099'
            }, {
                gt: 300,
                color: '#7e0023'
            }],
            outOfRange: {
                color: '#999'
            }
        },
        series: {
            name: 'Beijing AQI',
            type: 'line',
            data: data.map(function (item) {
                return 200;
            }),
            markLine: {
                silent: true,
                data: [{
                    yAxis: 50
                }, {
                    yAxis: 100
                }, {
                    yAxis: 150
                }, {
                    yAxis: 200
                }, {
                    yAxis: 300
                }]
            }
        }
    });
});

其他信息 (Other comments)

qq 20160708144542

33

@pissang pissang added the bug label Jul 8, 2016
@pissang pissang closed this as completed in a66967f Jul 8, 2016
@pissang pissang changed the title 绘制如http://echarts.baidu.com/demo.html#line-aqi 的图形时,如果我的值都一样时,js报错! 绘制如http://echarts.baidu.com/demo.html#line-aqi 的图形时,如果我的值都一样时,js报错 Jul 11, 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

2 participants