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

BUG in datazoom slider #5226

Closed
akansal1 opened this Issue Mar 8, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@akansal1

akansal1 commented Mar 8, 2017

One-line summary [问题简述]

DataZoom slider no showing right behaivour when two x-axis are bind to equal length data, but series have unequal entries

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.4
  • Browser version [浏览器类型和版本]: Chrome

Expected behaviour [期望结果]

I want two or more categorical X-axis or Y-axis datazoom slider, with zoom in sync with length X-axis

ECharts option [ECharts配置项]

option = {
    title: {
        //text: '2000-2016年中国汽车销量及增长率'
    },
    dataZoom:[{type:'slider',show:'true',xAxisIndex: [0, 1] }],
    tooltip: {
        trigger: 'axis'
    },
    toolbox: {
        feature: {
            dataView: {
                show: true,
                readOnly: false
            },
            restore: {
                show: true
            },
            saveAsImage: {
                show: true
            }
        }
    },
    grid: {
        containLabel: true
    },
    legend: {
        data: ['增速','销量']
    },
    xAxis: [{
        type: 'category',
        axisTick: {
            alignWithLabel: true
        },
        data: ['2000','2001','2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012','2013','2014','2015','2016']
    },
    {
        type: 'category',
        axisTick: {
            alignWithLabel: true
        },
        data: ['2000','2001','2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012','2013','2014','2015','2016']
    }],
    yAxis: [{
        type: 'value',
        name: '销量',
        min: 0,
        max: 100,
        position: 'left'
    }],
    series: [{
        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: [['2000',1],['2001',13]
        ,['2002',37],['2003',35],['2004',15],
        ['2005',13],['2006',25],['2007',21],['2008',6],['2009',45]
        ,['2010',32],['2011',2],['2012',4],['2013',13],['2014',6],['2015',11],['2016',12]]
    }, {
        name: '销量',
        type: 'line',
        yAxisIndex: 0,
        xAxisIndex:1,
        stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
        data:  [['2000',1],['2001',13]
        ,['2002',37],['2003',35],['2004',15],
        ['2005',13],['2006',25],['2007',21],['2008',6],['2009',45]
        ,['2010',32],['2011',2],['2012',4],['2013',13],['2014',6]]
    }]
};

Other comments [其他信息]

@akansal1 akansal1 changed the title from Possible BUG in datazoom slider to BUG in datazoom slider Mar 11, 2017

@akansal1

This comment has been minimized.

Show comment
Hide comment
@akansal1

akansal1 Mar 17, 2017

@100pah can you help in resolving issue above ?

@100pah can you help in resolving issue above ?

@100pah 100pah added the bug label Mar 17, 2017

@100pah

This comment has been minimized.

Show comment
Hide comment
@100pah

100pah Mar 17, 2017

Member

@akansal1 Temporarily, this issue can be resolved by setting xAxis.min and xAxis.max as follows:

xAxis: [{
    type: 'category',
    min: '2000',
    max: '2016',
    ...
},
{
    type: 'category',
    min: '2000',
    max: '2016',
    ...
}],

And then we will think this through to resolve it thoroughly.

Member

100pah commented Mar 17, 2017

@akansal1 Temporarily, this issue can be resolved by setting xAxis.min and xAxis.max as follows:

xAxis: [{
    type: 'category',
    min: '2000',
    max: '2016',
    ...
},
{
    type: 'category',
    min: '2000',
    max: '2016',
    ...
}],

And then we will think this through to resolve it thoroughly.

@100pah 100pah added enhancement and removed bug labels Mar 17, 2017

@100pah 100pah closed this in 7ba19c3 Mar 17, 2017

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