Skip to content

Commit d560fa8

Browse files
authored
fix(LineChart): set tooltip title to series name when trigger is item (#399)
1 parent e656a7f commit d560fa8

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/components/LineChart/handleOptipn.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ function defaultFormatter(params, color, iChartOpt, hideEmpty, tooltip) {
135135
});
136136
} else if(isObject(params)) {
137137
const dataItem = {
138-
name: params.seriesName || '',
139-
value: params.value || '',
140-
iconColor: validateName(params.value) ? params.color : getColor(color, params.seriesIndex),
141-
type: iChartOpt.legend?.icon
142-
}
143-
config.children.push(dataItem)
138+
name: params.seriesName || '',
139+
value: params.value || '',
140+
iconColor: validateName(params.value) ? params.color : getColor(color, params.seriesIndex),
141+
type: iChartOpt.legend?.icon
142+
}
143+
config.children.push(dataItem)
144+
config.title = params.name
144145
}
145146
const isMobile = mobile();
146147
config.isMobile = iChartOpt.isMobile || isMobile;

0 commit comments

Comments
 (0)