fix: HTML encode in the tooltip

This commit is contained in:
jsers 2020-06-01 18:04:52 +08:00
parent 61fc79ff47
commit 70c00f1424
1 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,8 @@ function singlePoint(pointData = {}, activeTooltipData) {
const value = numeral(pointData.value).format('0,0[.]000');
let name = tags;
name = _.chain(name).replace('<', '&lt;').replace('>', '&gt;').value();
// 对比情况下 name 特殊处理
if (isComparison) {
const mDate = serieOptions.comparison && typeof serieOptions.comparison === 'number' ? moment(timestamp).subtract(serieOptions.comparison, 'seconds') : moment(timestamp);