mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 13:21:36 +00:00
增加更新Axis数据和图标的接口
This commit is contained in:
@@ -107,6 +107,22 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update category data.
|
||||
/// 更新X轴类目数据。
|
||||
/// </summary>
|
||||
/// <param name="index">the index of category data</param>
|
||||
/// <param name="category"></param>
|
||||
/// <param name="xAxisIndex">which xAxis index to update to</param>
|
||||
public void UpdateXAxisData(int index, string category, int xAxisIndex = 0)
|
||||
{
|
||||
var xAxis = GetXAxis(xAxisIndex);
|
||||
if (xAxis != null)
|
||||
{
|
||||
xAxis.UpdateData(index, category);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an icon to xAxis.
|
||||
/// 添加一个图标到指定的x轴。
|
||||
@@ -122,6 +138,22 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update xAxis icon.
|
||||
/// 更新X轴图标。
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="icon"></param>
|
||||
/// <param name="xAxisIndex"></param>
|
||||
public void UdpateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)
|
||||
{
|
||||
var xAxis = GetXAxis(xAxisIndex);
|
||||
if (xAxis != null)
|
||||
{
|
||||
xAxis.UpdateIcon(index, icon);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a category data to yAxis.
|
||||
/// 添加一个类目数据到指定的y轴。
|
||||
@@ -137,6 +169,22 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update category data.
|
||||
/// 更新Y轴类目数据。
|
||||
/// </summary>
|
||||
/// <param name="index">the index of category data</param>
|
||||
/// <param name="category"></param>
|
||||
/// <param name="yAxisIndex">which yAxis index to update to</param>
|
||||
public void UpdateYAxisData(int index, string category, int yAxisIndex = 0)
|
||||
{
|
||||
var yAxis = GetYAxis(yAxisIndex);
|
||||
if (yAxis != null)
|
||||
{
|
||||
yAxis.UpdateData(index, category);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an icon to yAxis.
|
||||
/// 添加一个图标到指定的y轴。
|
||||
@@ -152,6 +200,21 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新Y轴图标。
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="icon"></param>
|
||||
/// <param name="yAxisIndex"></param>
|
||||
public void UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0)
|
||||
{
|
||||
var yAxis = GetYAxis(yAxisIndex);
|
||||
if (yAxis != null)
|
||||
{
|
||||
yAxis.UpdateIcon(index, icon);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reutrn true when all the show axis is `Value` type.
|
||||
/// 纯数值坐标轴(数值轴或对数轴)。
|
||||
|
||||
Reference in New Issue
Block a user