Skip to content
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

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

Closed
ekuwang opened this issue Jan 13, 2016 · 4 comments
Closed
Labels

Comments

@ekuwang
Copy link

ekuwang commented Jan 13, 2016

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

@pissang
Copy link
Contributor

pissang commented Jan 13, 2016

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

@ekuwang
Copy link
Author

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
Copy link
Contributor

pissang commented Jan 13, 2016

我这试了下可以的。

echarts

@ekuwang
Copy link
Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants