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

折线图动态设置setOption->series->areaStyle ,无法生效 #2625

Closed
zhump opened this issue Feb 21, 2016 · 5 comments
Closed

折线图动态设置setOption->series->areaStyle ,无法生效 #2625

zhump opened this issue Feb 21, 2016 · 5 comments
Labels

Comments

@zhump
Copy link

zhump commented Feb 21, 2016

是我使用的问题的问题吗?
配置如下

option = {
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二','周三','周四','周五','周六','周日']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'邮件营销',
            type:'line',
            stack: '总量',
            data:[120, 132, 101, 134, 90, 230, 210]
        },
        {
            name:'联盟广告',
            type:'line',
            stack: '总量',
            areaStyle: {normal:{}},
            data:[220, 182, 191, 234, 290, 330, 310]
        }
    ]
};
setTimeout(function() {
    var option = myChart.getOption();
    option.series[0].areaStyle = {normal:{}};
    myChart.setOption(option)
}, 2000);
@zhump
Copy link
Author

zhump commented Feb 21, 2016

我去 无论我怎么排版,这代码排版还是这样,,无语了,,大神直接粘贴到案例中就能跑。
option.series[0].areaStyle = {normal:{}};
就是这句话没有用,是我使用有问题吗?

@zhump
Copy link
Author

zhump commented Feb 21, 2016

@pissang 经过不断测试,发现雷达图这么设置却是可以的!
包括这么去设设置也是可以的

option.series[0].itemStyle = { normal: { areaStyle: {} } }
大神有时间帮忙看下为什么折线图不行呀,还有个悲催的现象,设置过areaStyle,使用setOption就不能让他去掉areaStyle,只能使用 areaStyle.normal.opacity 的方法暂时透明度为0,按理说覆盖areaStyle,区域显示应该消失,这个问题在雷达图中也能重现。

chart.setOption({
                    legend: {
                        data: ['radar', 'radar2', 'radar3']
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    polar: {},
                    angleAxis: {
                        data: xAxisData,
                        boundaryGap: false
                    },
                    radiusAxis: {
                    },
                    series: [{
                        name: 'radar',
                        stack: 'all',
                        type: 'radar',
                        symbolSize: 10,
                        data: data1
                    }, {
                        name: 'radar2',
                        stack: 'all',
                        type: 'radar',
                        symbolSize: 10,
                        data: data2
                    }, {
                        name: 'radar3',
                        stack: 'all',
                        type: 'radar',
                        data: data3
                    }]
                });
                 setTimeout(function() {
                     var option = chart.getOption();
                   option.series[0].areaStyle = {normal:{}};
                   chart.setOption(option)
        }, 2000);

@pissang
Copy link
Contributor

pissang commented Feb 21, 2016

外面包上

```js 
```

@zhump
Copy link
Author

zhump commented Feb 22, 2016

@pissang 大神我已经将代码格式好了,能帮忙看一下为什么折线图这么去设置而不生效?
option.series[0].areaStyle = {normal:{}};
顺便问一下,v3最近有没有版本更新计划呀。

@pissang pissang added the bug label Feb 22, 2016
@pissang
Copy link
Contributor

pissang commented Feb 22, 2016

确认是 bug,明后天发 3.0.3

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