echarts icon indicating copy to clipboard operation
echarts copied to clipboard

请问现在DataZoom的slider模式和框选模式可以搭配使用吗?

Open Mapleaf-C opened this issue 10 years ago • 1 comments

使用缩放框缩放后slider条无法还原图形,其他线条全部消失了,只能通过“区域缩放还原”按钮返回。这两个缩放在3.0中无法搭配使用吗?还是说我的配置有问题? option如下:

    option = {
     dataZoom :  [{
            type: 'slider',
            show: true,
        }],
    tooltip : {
        trigger: 'value'
    },
    legend: {
        data:['测试数据']
    },
    toolbox: {
        show : true,
        feature : {
            dataZoom: {},
            dataView: {readOnly: false},
            magicType: {type: ['line', 'bar']},
            restore: {},
            saveAsImage: {}
        }
    },
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二','周三','周四','周五','周六','周日']
        }
    ],
    yAxis : [
        {
            type : 'value',
        }
    ],
    series : [
        {
            name:'测试数据',
            type:'line',
            data:[1, -2, 2, 5, 3, 2, 0],

        }
    ]};

Mapleaf-C avatar Jan 25 '16 08:01 Mapleaf-C

这个原因是,默认情况,tooltip中的dataZoom是横纵轴都同时缩放,但是你的配置项中,只提供了横轴的slider条,只能还原横轴的。纵轴还是处于『放大』状态。

可以设置 toolbox.feature.dataZoom.yAxisIndex 为false,来禁用y轴 的 toolbox datazoom 缩放

100pah avatar Jan 25 '16 13:01 100pah