apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.59k stars 19.62k forks source link

echarts4.0.3 iOS x,y轴formatter出错 #7830

Closed muwan closed 4 years ago

muwan commented 6 years ago

One-line summary [问题简述]

echarts4.0.3 iOS x,y轴formatter出错 在echarts 3版本中未出现问题

Version & Environment [版本及环境]

Expected behaviour [期望结果]

formatter所需要的function可以以字符串形式展示出来

ECharts option [ECharts配置项]

option = {
    "series": [{
        "type": "bar",
        "name": "数值",
        "data": [1, 1, 1, 4]
    }],
    "legend": {
        "y": "top",
        "data": ["数值"],
        "orient": "horizontal",
        "show": true,
        "type": "scroll",
        "x": "center"
    },
    "xAxis": {
        "axisLabel": {
            "show": true,
            "clickable": false,
            "rotate": 45,
            "formatter": "(function(param) { if (param.length > 5) { param = param.substr(0, 5) + '..'; } return param;})"
        },
        "boundaryGap": [0, 0.01],
        "nameTextStyle": {
            "fontSize": 10,
            "padding": [20, 0, 0, 0]
        },
        "nameLocation": "middle",
        "nameGap": 50,
        "type": "value",
        "name": "属地管理"
    },
    "animation": true,
    "title": {
        "show": true,
        "text": ""
    },
    "grid": {
        "zlevel": 0,
        "containLabel": true,
        "show": false,
        "z": 0,
        "borderWidth": 1,
        "left": "5%",
        "right": "5%"
    },
    "tooltip": {
        "show": true
    },
    "yAxis": {
        "axisLabel": {
            "show": true,
            "clickable": false,
            "rotate": 45,
            "formatter": "(function(param) { if (param.length > 5) { param = param.substr(0, 5) + '..'; } return param;})"
        },
        "nameTextStyle": {
            "fontSize": 10,
            "padding": [0, 0, 0, 20]
        },
        "data": ["2013-02", "2014-07", "2017-02", "2017-11"],
        "boundaryGap": [0, 0.01],
        "nameLocation": "end",
        "type": "category",
        "name": "时间",
        "interval": "0"
    },
    "dataZoom": [{
        "end": 100,
        "zoomLock": false,
        "yAxisIndex": 0,
        "start": 0,
        "show": false,
        "filterMode": "filter",
        "type": "inside"
    }],
    "textStyle": {
        "fontSize": 10,
        "width": "5"
    }
}

Other comments [其他信息]

错误截图

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.