Skip to content

Stacked Bar with dataZoom regression (4.1.0) #8935

Closed

Description

@warrenspe

One-line summary [问题简述]

stacked bar charts exceed zoom limit in 4.1.0

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.1.0
  • Browser version [浏览器类型和版本]: Firefox 62.0b17
  • OS Version [操作系统类型和版本]: Windows 10

Expected behaviour [期望结果]

See this fiddle, loading echarts 3.2.2
Expected (3.2.2): http://jsfiddle.net/cj31rtpf/1208/
Actual (4.1.0): http://jsfiddle.net/cj31rtpf/1209/

ECharts option [ECharts配置项]

option = {
    title: {
        text: '世界人口总量',
        subtext: '数据来自网络'
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        data: ['2011年', '2012年']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    yAxis: {
        type: 'value',
        boundaryGap: [0, 0.01]
    },
    xAxis: {
        type: 'category',
        data: ['巴西','印尼','美国','印度','中国','世界人口(万)']
    },
    dataZoom: [
        {
            "type": "slider",
            "xAxisIndex": 0,
            "backgroundColor": "rgba(255,255,255,0)",
            "fillerColor": "rgba(255,255,255,0.4)",
            "zoomOnMouseWheel": false,
            "showDetail": false
        },
        {
            "type": "slider",
            "yAxisIndex": 0,
            "zoomOnMouseWheel": false,
            "showDetail": false
        }
    ],
    series: [
        {
            name: '2011年',
            type: 'bar',
            stack: 'overall',
            data: [18203, 23489, 29034, 104970, 131744, 630230]
        },
        {
            name: '2012年',
            type: 'bar',
            stack: 'overall',
            data: [19325, 23438, 31000, 121594, 134141, 681807]
        }
    ]
};

Other comments [其他信息]

See this fiddle, loading echarts 3.2.2
Expected (3.2.2): http://jsfiddle.net/cj31rtpf/1208/
Actual (4.1.0): http://jsfiddle.net/cj31rtpf/1209/

Activity

  1. self-assigned this
    on Aug 27, 2018
  2. Ovilia commented on Aug 30, 2018

    @Ovilia
    Contributor

    目前定位到问题是在 2fddc7f 这个 commit 中引起的

  3. jarben commented on Sep 5, 2018

    @jarben
    Contributor

    Perhaps another instance of this bug:
    image
    Code:

    
    myChart.showLoading();
    
    $.get('data/asset/data/obama_budget_proposal_2012.list.json', function (obama_budget_2012) {
        myChart.hideLoading();
    
        option = {
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                    label: {
                        show: true
                    }
                }
            },
            toolbox: {
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType: {show: true, type: ['line', 'bar']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            calculable : true,
            legend: {
                data:['Growth', 'Budget 2011', 'Budget 2012'],
                itemGap: 5
            },
            grid: {
                top: '12%',
                left: '1%',
                right: '10%',
                containLabel: true
            },
            yAxis: [
                {
                    type : 'category',
                    data : obama_budget_2012.names
                }
            ],
            xAxis: [
                {
                    type : 'value',
                    name : 'Budget (million USD)',
                    axisLabel: {
                        formatter: function (a) {
                            a = +a;
                            return isFinite(a)
                                ? echarts.format.addCommas(+a / 1000)
                                : '';
                        }
                    }
                }
            ],
            dataZoom: [
                {
                    show: true,
                    start: 5,
                    end: 20
                },
                {
                    type: 'inside',
                    start: 0,
                    end: 10
                },
                {
                    show: true,
                    yAxisIndex: 0,
                    filterMode: 'empty',
                    start:90,
                    end:100,
                    width: 30,
                    height: '80%',
                    showDataShadow: false,
                    left: '93%'
                }
            ],
            series : [
                {
                    name: 'Budget 2011',
                    type: 'bar',
                    stack:true,
                    data: obama_budget_2012.budget2011List
                },
                {
                    name: 'Budget 2012',
                    stack:true,
                    type: 'bar',
                    data: obama_budget_2012.budget2012List
                }
            ]
        };
    
        myChart.setOption(option);
    
    });
    
  4. jarben commented on Sep 10, 2018

    @jarben
    Contributor

    Any thoughts around when this is going to be fixed & released @Ovilia ?

  5. Ovilia commented on Oct 12, 2018

    @Ovilia
    Contributor

    @100pah says that dataZoom of stacked bars were not supported yet but somehow it worked before. He will fix it later.

  6. jarben commented on Oct 12, 2018

    @jarben
    Contributor

    Thanks for looking at this @Ovilia !

  7. added this to the 4.3.0 milestone on Jan 29, 2019
  8. removed their assignment
    on Feb 14, 2019
  9. 15531400827 commented on Feb 28, 2019

    @15531400827

    @Ovilia 问一下问题还不能解决吗? 问题都抛出半年了把。。。。。。

  10. added
    en
    on Mar 6, 2019
  11. removed this from the 4.3.0 milestone on Mar 8, 2019
  12. added this to the 4.4.0 milestone on Aug 27, 2019
  13. self-assigned this
    on Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugenpriority: high

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions