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

Series的z和z-level设置 #1648

Closed
shady7shen opened this issue Jun 9, 2015 · 5 comments
Closed

Series的z和z-level设置 #1648

shady7shen opened this issue Jun 9, 2015 · 5 comments

Comments

@shady7shen
Copy link

根据#1291 ,Series的zlevel 和 z不生效,只能用theme针对series类型设置z-level和z。

但是有没有办法做到将series 按照 area < bar < line 的顺序设置z-index 顺序?因为area本质上任然是line(只是有areaStyle设置)

感谢 ~

@pissang
Copy link
Contributor

pissang commented Jun 9, 2015

这是老版本的,2.2.2 开始支持在 option 里设置 z 和 zlevel 了,目前 area 本质上是 line 所以确实无法设置不同的 zlevel

@shady7shen
Copy link
Author

使用以下设置,zlevel 都是1 , ‘视频广告“(红线 z=10) > "直接访问" (绿柱 z=5) > "搜索引擎" (蓝区域 z=1)
但是结果还是绿色的柱子在最前面。。。
z 和 zlevel 似乎没有生效

option = {
    color : [ 'red', 'green', 'blue'],
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['视频广告','直接访问','搜索引擎']
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap : true,
            data : ['周一','周二','周三','周四','周五','周六','周日']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'视频广告',
            z: 10,
            zlevel: 1,
            type:'line',
            stack: '总量',
            data:[150, 232, 201, 154, 190, 330, 410]
        },
        {
            name:'直接访问',
            z: 5,
            zlevel: 1,
            type:'bar',
            data:[320, 332, 301, 334, 390, 330, 320]
        },
        {
            name:'搜索引擎',
            type:'line',
            z: 1,
            zlevel: 1,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:[820, 932, 901, 934, 1290, 1330, 1320]
        }
    ]
};

@pissang
Copy link
Contributor

pissang commented Jun 9, 2015

目前同个类型的图表的 z 和 zlevel 是相同的,取得最后一个 series 的设置,后面会改成每个系列的 z 和 zlevel 的配置独立

@shady7shen
Copy link
Author

好的,单独配置感觉更合理,希望能早日实现

@yyz945947732
Copy link

@pissang 想知道现在改成独立的配置了吗?
在线等,挺急的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants