建议:markline计算平均值时可以过滤掉空值 #3367

Closed
tianjianwei1990 opened this Issue Jun 6, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@tianjianwei1990

问题简述 (One-line summary)

markline计算平均值时可以过滤掉空值(或非数字)

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts v3.1.10):

ECharts配置项 (ECharts option)

option = {
title: {
        text: '未来一周气温变化',
        subtext: '纯属虚构'
    },
    tooltip: {
        trigger: 'axis'
    },
    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',
        axisLabel: {
            formatter: '{value} °C'
        }
    },
    series: [
        {
            name:'最高气温',
            type:'line',
            data:[11, 11, 15, 13, 12, 13, null],
            markPoint: {
                data: [
                    {type: 'max', name: '最大值'},
                    {type: 'min', name: '最小值'}
                ]
            },
            markLine: {
                data: [
                    {type: 'average', name: '平均值'}
                ]
            }
        }
    ]
}

@pissang pissang closed this Jun 6, 2016

@pissang pissang reopened this Jun 6, 2016

@pissang pissang closed this in 0aa31e3 Jun 6, 2016

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