dataZoom的缩略图右侧最后一个数据点总是下降归0 #2462

Closed
firezym opened this Issue Jan 20, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@firezym

firezym commented Jan 20, 2016

当数据量较少的时候,dataZoom的缩略图右侧最后一个数据点总是下降归0,趋势和正常数据不一样,看了很多图表都是这个样子的,是否可以修复这个bug?

var timeData = [
    '2009/6/12 3:00', '2009/6/12 4:00', '2009/6/12 5:00', '2009/6/12 6:00', '2009/6/12 7:00', '2009/6/12 8:00'];

timeData = timeData.map(function (str) {
    return str.replace('2009/', '');
});

option = {
    title : {
        text: '雨量流量关系图',
        subtext: '数据来自西安兰特水电测控技术有限公司',
        x: 'center'
    },
    tooltip : {
        trigger: 'axis',
        formatter: function(params) {
            return params[0].name + '<br/>'
                + params[0].seriesName + ' : ' + params[0].value + ' (m^3/s)<br/>';
        },
        axisPointer: {
            animation: false
        }
    },
    legend: {
        data:['流量','降雨量'],
        x: 'left'
    },
    dataZoom: [
        {
            show: true,
            realtime: true,
            start: 30,
            end: 70,
            xAxisIndex: [0, 1]
        },
        {
            type: 'inside',
            realtime: true,
            start: 30,
            end: 70,
            xAxisIndex: [0,1]
        }
    ],
    grid: [{
        left: 50,
        right: 50,
        height: '35%'
    }, {
        left: 50,
        right: 50,
        top: '55%',
        height: '35%'
    }],
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            axisLine: {onZero: true},
            data: timeData
        },
        {
            gridIndex: 1,
            type : 'category',
            boundaryGap : false,
            axisLine: {onZero: true},
            data: timeData,
            position: 'top'
        }
    ],
    yAxis : [
        {
            name : '流量(m^3/s)',
            type : 'value',
            max : 500
        },
        {
            gridIndex: 1,
            name : '降雨量(mm)',
            type : 'value',
            inverse: true
        }
    ],
    series : [
        {
            name:'流量',
            type:'line',
            symbolSize: 8,
            itemStyle: {
                emphasis: {
                }
            },
            hoverAnimation: false,
            data:[
                2,2,2,2,2,2]
        },
        {
            name:'降雨量',
            type:'line',
            xAxisIndex: 1,
            yAxisIndex: 1,
            symbolSize: 8,
            itemStyle: {
                emphasis: {
                }
            },
            hoverAnimation: false,
            data: [
                2,2,2,2,2,2]
        }
    ]
};

@pissang pissang added the bug label Jan 21, 2016

@pissang pissang closed this in 36f7d0f Jan 21, 2016

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