diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 5b6661d2..f55222af 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -72,6 +72,7 @@ slug: /changelog ## master +* (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 * (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 ## v3.10.1 diff --git a/Runtime/Helper/FormatterHelper.cs b/Runtime/Helper/FormatterHelper.cs index 43fbd35c..6a9ac8ad 100644 --- a/Runtime/Helper/FormatterHelper.cs +++ b/Runtime/Helper/FormatterHelper.cs @@ -189,7 +189,7 @@ namespace XCharts.Runtime if (isPercent) { var total = serie.GetDataTotal(dimensionIndex, serie.GetSerieData(bIndex)); - var percent = total == 0 ? 0 : value / serie.yTotal * 100; + var percent = total == 0 ? 0 : value / total * 100; content = content.Replace(old, ChartCached.FloatToStr(percent, numericFormatter)); } else if (isTotal)