ECharts圖例組件配置 格式化文本

2020-11-17 15:24 更新

legend.formatter   |   string, Function

[ default: null ]

用來格式化圖例文本,支持字符串模板和回調(diào)函數(shù)兩種形式。

示例:

// 使用字符串模板,模板變量為圖例名稱 {name}
formatter: 'Legend {name}'
// 使用回調(diào)函數(shù)
formatter: function (name) {
    return 'Legend ' + name;
}
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號