3.0折线图中如果数据值为0,会显示为'-',且影响平均值计算 #2367

Closed
ekuwang opened this Issue Jan 13, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@ekuwang

ekuwang commented Jan 13, 2016

我在折线图中设置了平均值线,当有数据点为0时,图表显示为'-',且平均值线无法显示平均值。

@pissang

This comment has been minimized.

Show comment
Hide comment
@pissang

pissang Jan 13, 2016

Contributor

我试了没啥问题,你给下 option 看看

Contributor

pissang commented Jan 13, 2016

我试了没啥问题,你给下 option 看看

@ekuwang

This comment has been minimized.

Show comment
Hide comment
@ekuwang

ekuwang Jan 13, 2016

{
    "tooltip": {
        "trigger": "axis"
    },
    "noDataLoadingOption": {
        "effect": "whirling"
    },
    "legend": {
        "data": ["接收消息数", "发送消息数"],
        "y": "bottom"
    },
    "toolbox": {
        "show": true,
        "orient": "vertical",
        "feature": {
            "dataView": {
                "show": true,
                "readOnly": false
            },
            "magicType": {
                "show": true,
                "type": ["line", "bar"]
            },
            "restore": {
                "show": true
            },
            "saveAsImage": {
                "show": true
            }
        }
    },
    "calculable": true,
    "xAxis": [{
        "type": "category",
        "data": ["12-30", "12-31", "01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07", "01-08", "01-09", "01-10", "01-11", "01-12", "01-13"]
    }],
    "yAxis": [{
        "type": "value"
    }],
    "series": [{
        "name": "接收消息数",
        "data": [71, 64, 10, 1, 6, 5, 75, 53, 32, 107, 15, 7, 43, 102, 5],
        "type": "line",
        "smooth": true,
        "itemStyle": {
            "normal": {
                "areaStyle": {
                    "type": "default"
                }
            }
        },
        "markLine": {
            "precision": 0,
            "data": [{
                "type": "average",
                "name": "平均值"
            }]
        }
    }, {
        "name": "发送消息数",
        "data": [10, 27, 7, 0, 7, 7, 40, 40, 33, 104, 13, 1, 37, 85, 4],
        "type": "line",
        "smooth": true,
        "itemStyle": {
            "normal": {
                "areaStyle": {
                    "type": "default"
                }
            }
        },
        "markLine": {
            "precision": 0,
            "data": [{
                "type": "average",
                "name": "平均值"
            }]
        }
    }]
}

ekuwang commented Jan 13, 2016

{
    "tooltip": {
        "trigger": "axis"
    },
    "noDataLoadingOption": {
        "effect": "whirling"
    },
    "legend": {
        "data": ["接收消息数", "发送消息数"],
        "y": "bottom"
    },
    "toolbox": {
        "show": true,
        "orient": "vertical",
        "feature": {
            "dataView": {
                "show": true,
                "readOnly": false
            },
            "magicType": {
                "show": true,
                "type": ["line", "bar"]
            },
            "restore": {
                "show": true
            },
            "saveAsImage": {
                "show": true
            }
        }
    },
    "calculable": true,
    "xAxis": [{
        "type": "category",
        "data": ["12-30", "12-31", "01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07", "01-08", "01-09", "01-10", "01-11", "01-12", "01-13"]
    }],
    "yAxis": [{
        "type": "value"
    }],
    "series": [{
        "name": "接收消息数",
        "data": [71, 64, 10, 1, 6, 5, 75, 53, 32, 107, 15, 7, 43, 102, 5],
        "type": "line",
        "smooth": true,
        "itemStyle": {
            "normal": {
                "areaStyle": {
                    "type": "default"
                }
            }
        },
        "markLine": {
            "precision": 0,
            "data": [{
                "type": "average",
                "name": "平均值"
            }]
        }
    }, {
        "name": "发送消息数",
        "data": [10, 27, 7, 0, 7, 7, 40, 40, 33, 104, 13, 1, 37, 85, 4],
        "type": "line",
        "smooth": true,
        "itemStyle": {
            "normal": {
                "areaStyle": {
                    "type": "default"
                }
            }
        },
        "markLine": {
            "precision": 0,
            "data": [{
                "type": "average",
                "name": "平均值"
            }]
        }
    }]
}
@pissang

This comment has been minimized.

Show comment
Hide comment
@pissang

pissang Jan 13, 2016

Contributor

我这试了下可以的。

echarts

Contributor

pissang commented Jan 13, 2016

我这试了下可以的。

echarts

@ekuwang

This comment has been minimized.

Show comment
Hide comment
@ekuwang

ekuwang Jan 13, 2016

2016-01-13 10 50 08
3.0中的样子

image
2.0中的样子

请注意第二张图箭头指出的地方

ekuwang commented Jan 13, 2016

2016-01-13 10 50 08
3.0中的样子

image
2.0中的样子

请注意第二张图箭头指出的地方

@pissang pissang added the bug label Jan 13, 2016

@pissang pissang closed this in b975674 Jan 13, 2016

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