mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 08:50:10 +00:00
增加AxisLabel和SerieLabel的formatter委托方法 #145
This commit is contained in:
@@ -448,7 +448,7 @@ namespace XCharts
|
||||
string legendName = legend.GetFormatterContent(datas[i]);
|
||||
var readIndex = m_LegendRealShowName.IndexOf(datas[i]);
|
||||
var active = IsActiveByLegend(datas[i]);
|
||||
var bgColor = LegendHelper.GetIconColor(this, readIndex , datas[i], active);
|
||||
var bgColor = LegendHelper.GetIconColor(this, readIndex, datas[i], active);
|
||||
var item = LegendHelper.AddLegendItem(legend, i, datas[i], legendObject.transform, m_Theme,
|
||||
legendName, bgColor, active);
|
||||
legend.SetButton(legendName, item, totalLegend);
|
||||
|
||||
28
Runtime/Internal/Interface/DelegateFunction.cs
Normal file
28
Runtime/Internal/Interface/DelegateFunction.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
/// <summary>
|
||||
/// The delegate function for AxisLabel's formatter. |
|
||||
/// AxisLabel的formatter自定义委托。
|
||||
/// </summary>
|
||||
/// <param name="labelIndex">label索引</param>
|
||||
/// <param name="value">当前label对应的数值数据,Value轴或Time轴有效</param>
|
||||
/// <param name="category">当前label对应的类目数据,Category轴有效</param>
|
||||
/// <returns>最终显示的文本内容</returns>
|
||||
public delegate string DelegateAxisLabelFormatter(int labelIndex, float value, string category);
|
||||
/// <summary>
|
||||
/// The delegate function for SerieLabel‘s formatter.
|
||||
/// SerieLabel的formatter自定义委托。
|
||||
/// </summary>
|
||||
/// <param name="dataIndex">数据索引</param>
|
||||
/// <param name="value">数值</param>
|
||||
/// <returns>最终显示的文本内容</returns>
|
||||
public delegate string DelegateSerieLabelFormatter(int dataIndex, float value);
|
||||
}
|
||||
11
Runtime/Internal/Interface/DelegateFunction.cs.meta
Normal file
11
Runtime/Internal/Interface/DelegateFunction.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d9ec774e2e5b4d9ba407a27f60b6d71
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user