Skip to content

How do I draw 100% stacked column/bar chart ?  #8785

@vadasambar

Description

@vadasambar

I can't seem to find an option to make the height of all stacked y axis bars 100%.

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.1.0.rc2
  • Browser version [浏览器类型和版本]: Chrome 67.0.3396.99
  • OS Version [操作系统类型和版本]: macOS High Sierra 10.13.3

Expected behavior

This is what I want:
image

This is what I am getting now:
echarts demo 1

ECharts option [ECharts配置项]

option = {
    title: {
        text: 'Lorem Ipsum',
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['2018', '2019']
    },
    xAxis: {
        data: ['Foo','Bar','Baz'],

    },
    yAxis: {
        // type: 'category',
    },
    series: [
        {
            name: '2018',
            type: 'bar',
            data: [18203, 23489, 29034],
            markLine: {
                data: [{
                        name: 'Maximum',
                        type: 'max',
                    },
                    {
                        name: 'Minimum',
                        type: 'min',
                    }
                ]
            },
            stack: '1',
        },
        {
            name: '2019',
            type: 'bar',
            data: [ 10497, 13174, 63023],
            markLine: {
                data: [{
                        name: 'Maximum',
                        type: 'max',
                    },
                    {
                        name: 'Minimum',
                        type: 'min',
                    }
                ]
            },
            stack: '1'
        }
    ]
};

Other comments [其他信息]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions