优化Tooltipformatter支持{.1}类型的通配符

This commit is contained in:
monitor1394
2020-06-04 07:22:58 +08:00
parent b0866b3900
commit c18a7b99cb
4 changed files with 13 additions and 7 deletions

View File

@@ -313,11 +313,14 @@ namespace XCharts
}
if (p == '.')
{
if (argsCount == 1)
var bIndex = targetIndex;
if (argsCount >= 2)
{
content = content.Replace(old, ChartCached.ColorToDotStr(themeInfo.GetColor(targetIndex)));
foundDot = true;
var args1Str = args[1].ToString();
if (s_RegexN.IsMatch(args1Str)) bIndex = int.Parse(args1Str);
}
content = content.Replace(old, ChartCached.ColorToDotStr(themeInfo.GetColor(bIndex)));
foundDot = true;
}
else if (p == 'a' || p == 'A')
{