阅读(1755) (0)

ECharts图例组件配置 格式化文本

2017-09-01 14:35:09 更新

legend.formatter   |   string, Function

[ default: null ]

用来格式化图例文本,支持字符串模板和回调函数两种形式。

示例:

// 使用字符串模板,模板变量为图例名称 {name}
formatter: 'Legend {name}'
// 使用回调函数
formatter: function (name) {
    return 'Legend ' + name;
}