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

legend的滚动BUG #6756

Closed
melody00713 opened this Issue Sep 26, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@melody00713

melody00713 commented Sep 26, 2017

One-line summary [问题简述]

1.滚动的legend在某些高度下可能出现页码和实际不符的情况
2.当点击第二页图例 然后改变增高界面的重新resize()使图例可以一页显示 图例没有刷新被裁剪只能看到第二页

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: v3.7.1
  • Browser version [浏览器类型和版本]:chrome v60.0.3112.113
  • OS Version [操作系统类型和版本]:windows 10 家庭版 x64

Expected behaviour [期望结果]

1.页码和实际相符
2.resize后图例的滚动位置也重新计算

ECharts option [ECharts配置项]

var data = genData(50);

option = {
    title : {
        text: '同名数量统计',
        subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        type: 'scroll',
        orient: 'vertical',
        right: 10,
        top: 20,
        bottom: 20,
        data: data.legendData
    },
    series : [
        {
            name: '姓名',
            type: 'pie',
            radius : '55%',
            center: ['40%', '50%'],
            data: data.seriesData,
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};




function genData(count) {
    var nameList = [
        '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''
    ];
    var legendData = [];
    var seriesData = [];
    for (var i = 0; i < 50; i++) {
        name = Math.random() > 0.65
            ? makeWord(4, 1) + '·' + makeWord(3, 0)
            : makeWord(2, 1);
        legendData.push(name);
        seriesData.push({
            name: name,
            value: Math.round(Math.random() * 100000)
        });
    }

    return {
        legendData: legendData,
        seriesData: seriesData
    };

    function makeWord(max, min) {
        var nameLen = Math.ceil(Math.random() * max + min);
        var name = [];
        for (var i = 0; i < nameLen; i++) {
            name.push(nameList[Math.round(Math.random() * nameList.length - 1)]);
        }
        return name.join('');
    }
}

Other comments [其他信息]

#####当前应该是第三页 但是显示的是第四页
image
#####翻到第二页
image
#####变大resize后
image
#####正常效果
image

@100pah 100pah added the bug label Sep 28, 2017

@100pah 100pah closed this in 3f13fd9 Sep 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment