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

多Grid都定义了markLine的时候Markline只显示在最后一个grid里 #5712

Closed
shady7shen opened this issue May 10, 2017 · 1 comment
Closed
Labels

Comments

@shady7shen
Copy link

shady7shen commented May 10, 2017

One-line summary [问题简述]

多Grid都定义了markLine的时候,Markline只显示在最后一个grid里

Version & Environment [版本及环境]

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

Expected behaviour [期望结果]

不同的GridLine 显示各自的Markline

ECharts option [ECharts配置项]

app.title = '2000-2016年中国汽车销量及增长率';

option = {
    title: {
        //text: '2000-2016年中国汽车销量及增长率'
    },
    tooltip: {
        trigger: 'axis'
    },
    toolbox: {
        feature: {
            dataView: {
                show: true,
                readOnly: false
            },
            restore: {
                show: true
            },
            saveAsImage: {
                show: true
            }
        }
    },
    grid: [{
        left: '5%',
        top: '15%',
        width: '90%',
        height: '40%'
    }, {
        left: '5%',
        top: '55%',
        width: '90%',
        height: '40%'
    }],
    legend: {
        data: ['增速', '销量']
    },
    xAxis: [{
        gridIndex: 0,
        type: 'category',
        axisTick: {
            alignWithLabel: true
        },
        axisLabel:{
            show: false
        },
        data: ['2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016']
    }, {
        gridIndex: 1,
        type: 'category',
        axisTick: {
            alignWithLabel: true
        },
        data: ['2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016']
    }],
    yAxis: [{
        gridIndex: 0,
        type: 'value',
        name: '增速',
        min: 0,
        max: 50,
        position: 'right',
        axisLabel: {
            formatter: '{value} %'
        }
    }, {
        gridIndex: 0,
        type: 'value',
        name: '销量',
        min: 0,
        max: 3000,
        position: 'left'
    }, {
        gridIndex: 1,
        type: 'value',
        name: '增速',
        min: 0,
        max: 50,
        position: 'right',
        axisLabel: {
            formatter: '{value} %'
        }
    }, {
        gridIndex: 1,
        type: 'value',
        name: '销量',
        min: 0,
        max: 3000,
        position: 'left'
    }],
    series: [{
        xAxisIndex: 0,
        yAxisIndex: 0,
        name: '增速',
        type: 'line',
        stack: '总量',
        label: {
            normal: {
                show: true,
                position: 'top',
            }
        },
        lineStyle: {
            normal: {
                width: 3,
                shadowColor: 'rgba(0,0,0,0.4)',
                shadowBlur: 10,
                shadowOffsetY: 10
            }
        },
        data: [1, 13, 37, 35, 15, 13, 25, 21, 6, 45, 32, 2, 4, 13, 6, 4, 11]
    }, {
        name: '销量',
        type: 'bar',
        yAxisIndex: 1,
        xAxisIndex: 0,
        stack: '总量',
        label: {
            normal: {
                show: true,
                position: 'top'
            }
        },
        data: [209, 236, 325, 439, 507, 576, 722, 879, 938, 1364, 1806, 1851, 1931, 2198, 2349, 2460, 2735],
        markLine: {
            symbol: ['none', 'none'],
            label: {
                normal: {
                    show: false
                }
            },
            lineStyle: {
                normal: {
                    color: '#e54035',
                    width: 2
                }
            },
            data: [
                [{
                    coord: ["2000", 2000]
                }, {
                    coord: ["2016", 3000]
                }]
            ]
        },
        markPoint: {
            data: [{
                coord: ["2000", 2000],
                symbol: "circle",
                symbolSize: 20
            }]
        }
    }, {
        yAxisIndex: 2,
        xAxisIndex: 1,
        name: '增速',
        type: 'line',
        stack: '总量2',
        label: {
            normal: {
                show: true,
                position: 'top',
            }
        },
        lineStyle: {
            normal: {
                width: 3,
                shadowColor: 'rgba(0,0,0,0.4)',
                shadowBlur: 10,
                shadowOffsetY: 10
            }
        },
        data: [1, 13, 37, 35, 15, 13, 25, 21, 6, 45, 32, 2, 4, 13, 6, 4, 11]
    }, {
        name: '销量',
        type: 'bar',
        yAxisIndex: 3,
        xAxisIndex: 1,
        stack: '总量2',
        label: {
            normal: {
                show: true,
                position: 'top'
            }
        },
        data: [209, 236, 325, 439, 507, 576, 722, 879, 938, 1364, 1806, 1851, 1931, 2198, 2349, 2460, 2735],
        markLine: {
            symbol: ['none', 'none'],
            label: {
                normal: {
                    show: false
                }
            },
            lineStyle: {
                normal: {
                    color: '#e54035',
                    width: 2
                }
            },
            data: [
                [{
                    coord: ["2000", 2000]
                }, {
                    coord: ["2016", 2000]
                }]
            ]
        },
        markPoint: {
            data: [{
                coord: ["2000", 2000],
                symbol: "circle",
                symbolSize: 20
            }]
        }

    }]
};
@pissang pissang closed this as completed May 24, 2017
@shady7shen
Copy link
Author

shady7shen commented May 30, 2017

Is the issue fixed or what? @pissang

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

3 participants