mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-15 21:00:11 +00:00
修复PieChart的Label无法自动更新的问题
This commit is contained in:
@@ -639,6 +639,19 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateDataName(int index, string name)
|
||||
{
|
||||
if (index >= 0 && index < m_Data.Count)
|
||||
{
|
||||
var serieData = m_Data[index];
|
||||
serieData.name = name;
|
||||
if (serieData.label != null)
|
||||
{
|
||||
serieData.label.text = name == null ? "" : name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有数据的高亮标志
|
||||
/// </summary>
|
||||
|
||||
@@ -332,6 +332,24 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateDataName(string serieName, string dataName, int dataIndex = 0)
|
||||
{
|
||||
var serie = GetSerie(serieName);
|
||||
if (serie != null)
|
||||
{
|
||||
serie.UpdateDataName(dataIndex, dataName);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateDataName(int serieIndex, string dataName, int dataIndex = 0)
|
||||
{
|
||||
var serie = GetSerie(serieIndex);
|
||||
if (serie != null)
|
||||
{
|
||||
serie.UpdateDataName(dataIndex, dataName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新指定系列的维度Y数据
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user