mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-27 11:40:13 +00:00
3.0 - tooltip
This commit is contained in:
@@ -96,6 +96,10 @@ namespace XCharts
|
||||
/// </summary>
|
||||
public Action<PointerEventData, int> onPointerClickBar { set { m_OnPointerClickBar = value; m_ForceOpenRaycastTarget = true; } }
|
||||
/// <summary>
|
||||
/// 坐标轴变更数据索引时回调。参数:axis, dataIndex/dataValue
|
||||
/// </summary>
|
||||
public Action<Axis, double> onUpdateAxisPointer { set { m_OnUpdateAxisPointer = value; } get { return m_OnUpdateAxisPointer; } }
|
||||
/// <summary>
|
||||
/// Redraw chart in next frame.
|
||||
/// 在下一帧刷新图表。
|
||||
/// </summary>
|
||||
|
||||
@@ -55,12 +55,12 @@ namespace XCharts
|
||||
{
|
||||
if (!CanAddChartComponent(type))
|
||||
{
|
||||
throw new InvalidOperationException("DisallowMultipleComponent:" + type.Name);
|
||||
throw new InvalidOperationException("CanAddChartComponent:" + type.Name);
|
||||
}
|
||||
CheckAddRequireChartComponent(type);
|
||||
var component = Activator.CreateInstance(type) as MainComponent;
|
||||
if (component == null)
|
||||
throw new InvalidOperationException("DisallowMultipleComponent:" + type.Name);
|
||||
throw new InvalidOperationException("CanAddChartComponent:" + type.Name);
|
||||
component.SetDefaultValue();
|
||||
if (component is IUpdateRuntimeData)
|
||||
(component as IUpdateRuntimeData).UpdateRuntimeData(chartX, chartY, chartWidth, chartHeight);
|
||||
|
||||
@@ -484,6 +484,26 @@ namespace XCharts
|
||||
return false;
|
||||
}
|
||||
|
||||
public double GetData(string serieName, int dataIndex, int dimension = 1)
|
||||
{
|
||||
var serie = GetSerie(serieName);
|
||||
if (serie != null)
|
||||
{
|
||||
return serie.GetData(dataIndex, dimension);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double GetData(int serieIndex, int dataIndex, int dimension = 1)
|
||||
{
|
||||
var serie = GetSerie(serieIndex);
|
||||
if (serie != null)
|
||||
{
|
||||
return serie.GetData(dataIndex, dimension);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int GetAllSerieDataCount()
|
||||
{
|
||||
var total = 0;
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace XCharts
|
||||
protected Action<VertexHelper, Serie> m_OnCustomDrawSerieAfterCallback;
|
||||
protected Action<PointerEventData, int, int> m_OnPointerClickPie;
|
||||
protected Action<PointerEventData, int> m_OnPointerClickBar;
|
||||
protected Action<Axis, double> m_OnUpdateAxisPointer;
|
||||
|
||||
internal bool m_CheckAnimation = false;
|
||||
internal protected List<string> m_LegendRealShowName = new List<string>();
|
||||
@@ -309,7 +310,7 @@ namespace XCharts
|
||||
painter.onPopulateMesh = OnDrawPainterSerie;
|
||||
painter.SetActive(false, m_DebugMode);
|
||||
painter.material = settings.seriePainterMaterial;
|
||||
painter.transform.SetSiblingIndex(i + 1);
|
||||
painter.transform.SetSiblingIndex(index + 1);
|
||||
m_PainterList.Add(painter);
|
||||
}
|
||||
m_PainterTop = ChartHelper.AddPainterObject("painter_t", transform, m_GraphMinAnchor,
|
||||
@@ -318,7 +319,7 @@ namespace XCharts
|
||||
m_PainterTop.onPopulateMesh = OnDrawPainterTop;
|
||||
m_PainterTop.SetActive(true, m_DebugMode);
|
||||
m_PainterTop.material = settings.topPainterMaterial;
|
||||
m_PainterTop.transform.SetSiblingIndex(settings.maxPainter);
|
||||
m_PainterTop.transform.SetSiblingIndex(settings.maxPainter + 1);
|
||||
}
|
||||
|
||||
internal void InitComponentHandlers()
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace XCharts
|
||||
public static class XChartsMgr
|
||||
{
|
||||
public static readonly string version = "3.0.0";
|
||||
public static readonly int versionDate = 20210724;
|
||||
public static readonly int versionDate = 20220101;
|
||||
public static string fullVersion { get { return version + "-" + versionDate; } }
|
||||
|
||||
internal static List<BaseChart> chartList = new List<BaseChart>();
|
||||
|
||||
Reference in New Issue
Block a user