Skip to content

Commit

Permalink
feat: add joinString property for legend.
Browse files Browse the repository at this point in the history
  • Loading branch information
simaQ committed Jun 9, 2018
1 parent 1942e3b commit 7bc7676
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/component/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ class List {
* 布局方式
* @type {String}
*/
layout: 'horizontal'
layout: 'horizontal',
/**
* name 和 value 的连接字符串
* @type {String}
*/
joinString: ': '
};
}

Expand Down Expand Up @@ -189,7 +194,8 @@ class List {
let nameText;
let name = item.name;
if (name) {
name = value ? name + ': ' : name;
const joinString = this.joinString || '';
name = value ? name + joinString : name;
nameText = itemGroup.addShape('text', {
className: 'name',
attrs: Util.mix({
Expand Down

0 comments on commit 7bc7676

Please sign in to comment.