v-charts对label数字进行格式化

html代码:

<ve-histogram :data="enterpriseNumAverageData" :settings="enterpriseNumAverageSettings" :extend="extend" ref="chart3"></ve-histogram>

js代码:

enterpriseNumAverageSettings: {
    showLine: ['项目平均用款天数(已回本)'],
    axisSite: { right: ['项目平均用款天数(已回本)'] },
    yAxisType: ['normal', 'normal'],
    yAxisName: ['单位:元', '单位:天'],
},

extend: {
            series: {
                label: {
                    show: true, position: "top", formatter: function (params) {
                        if (params.componentSubType == "bar") {
                            let value = params.data;
                            return top.learun.numFilter(value, 2);
                        }
                    }
                },
            }
        }

posted @ 2019-09-16 10:30  wjs0509  阅读(1302)  评论(0编辑  收藏  举报