增加{y}通配符用于获取Y轴的类目名

This commit is contained in:
monitor1394
2024-01-23 22:56:03 +08:00
parent 9e39150009
commit 61a2da10ba
9 changed files with 74 additions and 21 deletions

View File

@@ -123,13 +123,14 @@ namespace XCharts.Runtime
/// Template placeholder have the following, some of which apply only to fixed components: <br />
/// `{.}` : indicates the dot mark. <br />
/// `{a}` : indicates the series name. <br />
/// `{b}` : category value or data name. <br />
/// `{b}` : category value of x axis or data name. <br />
/// `{c}` : data value. <br />
/// `{d}` : percentage. <br />
/// `{e}` : indicates the data name. <br />
/// `{f}` : data sum. <br />
/// `{g}` : indicates the total number of data. <br />
/// `{h}` : hexadecimal color value. <br />
/// `{y}` : category value of y axis. <br />
/// `{value}` : The value of the axis or legend. <br />
/// The following placeholder apply to `UITable` components: <br />
/// `{name}` : indicates the row name of the table. <br />
@@ -151,13 +152,14 @@ namespace XCharts.Runtime
/// 模板通配符有以下这些,部分只适用于固定的组件:<br/>
/// `{.}`:圆点标记。<br/>
/// `{a}`:系列名。<br/>
/// `{b}`:类目或数据名。<br/>
/// `{b}`X轴类目或数据名。<br/>
/// `{c}`:数据值。<br/>
/// `{d}`:百分比。<br/>
/// `{e}`:数据名。<br/>
/// `{f}`:数据和。<br/>
/// `{g}`:数据总个数。<br/>
/// `{h}`:十六进制颜色值。<br/>
/// `{y}`Y轴的类目名。<br/>
/// `{value}`:坐标轴或图例的值。<br/>
/// 以下通配符适用UITable组件<br/>
/// `{name}` 表格的行名。<br/>

View File

@@ -24,7 +24,7 @@ namespace XCharts.Runtime
}
public static string GetFormatterContent(Serie serie, SerieData serieData,
double dataValue, double dataTotal, LabelStyle serieLabel, Color color)
double dataValue, double dataTotal, LabelStyle serieLabel, Color color, BaseChart chart = null)
{
if (serieLabel == null)
{
@@ -45,7 +45,7 @@ namespace XCharts.Runtime
{
var content = serieLabel.formatter;
FormatterHelper.ReplaceSerieLabelContent(ref content, numericFormatter, serie.dataCount, dataValue,
dataTotal, serieName, dataName, dataName, color, serieData);
dataTotal, serieName, dataName, dataName, color, serieData, chart);
if (serieLabel.formatterFunction == null)
return content;
else
@@ -70,7 +70,5 @@ namespace XCharts.Runtime
serieData.labelObject.text.SetColor(label.textStyle.color);
}
}
}
}