mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 05:50:09 +00:00
修复CoordinateChart的tooltip报错
This commit is contained in:
@@ -214,6 +214,15 @@ namespace XCharts
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Contains(SerieType type)
|
||||
{
|
||||
foreach (var serie in m_Series)
|
||||
{
|
||||
if (serie.type == type) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove serie from series.
|
||||
/// 移除指定名字的系列。
|
||||
@@ -327,7 +336,7 @@ namespace XCharts
|
||||
return null;
|
||||
}
|
||||
|
||||
public SerieData AddData(string serieName, float open, float close, float lowest, float heighest, string dataName = null)
|
||||
public SerieData AddData(string serieName, float open, float close, float lowest, float heighest, string dataName = null)
|
||||
{
|
||||
var serie = GetSerie(serieName);
|
||||
if (serie != null)
|
||||
|
||||
@@ -481,9 +481,8 @@ namespace XCharts
|
||||
/// </summary>
|
||||
internal void UpdateLastDataIndex()
|
||||
{
|
||||
lastDataIndex[0] = runtimeDataIndex[0];
|
||||
if (runtimeDataIndex.Count > 1)
|
||||
lastDataIndex[1] = runtimeDataIndex[1];
|
||||
if (lastDataIndex.Count > 0 && runtimeDataIndex.Count > 0) lastDataIndex[0] = runtimeDataIndex[0];
|
||||
if (lastDataIndex.Count > 0 && runtimeDataIndex.Count > 1) lastDataIndex[1] = runtimeDataIndex[1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace XCharts
|
||||
|
||||
public bool CheckTootipArea(Vector2 local)
|
||||
{
|
||||
if (chart.series.Contains(SerieType.Gauge)) return false;
|
||||
var serie = GetPointerInSerieIndex(chart.series, local);
|
||||
if (serie != null)
|
||||
{
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace XCharts
|
||||
|
||||
public bool CheckTootipArea(Vector2 local)
|
||||
{
|
||||
if (chart.series.Contains(SerieType.Pie)) return false;
|
||||
bool selected = false;
|
||||
chart.tooltip.runtimeDataIndex.Clear();
|
||||
foreach (var serie in chart.series.list)
|
||||
@@ -102,7 +103,7 @@ namespace XCharts
|
||||
chart.tooltip.SetActive(false);
|
||||
chart.RefreshChart();
|
||||
}
|
||||
return true;
|
||||
return selected;
|
||||
}
|
||||
|
||||
public bool OnLegendButtonClick(int index, string legendName, bool show)
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace XCharts
|
||||
|
||||
public bool CheckTootipArea(Vector2 local)
|
||||
{
|
||||
if (chart.series.Contains(SerieType.Radar)) return false;
|
||||
if (m_IsEnterLegendButtom) return false;
|
||||
if (!IsInRadar(local)) return false;
|
||||
bool highlight = false;
|
||||
|
||||
@@ -127,6 +127,7 @@ namespace XCharts
|
||||
|
||||
public bool CheckTootipArea(Vector2 local)
|
||||
{
|
||||
if (chart.series.Contains(SerieType.Ring)) return false;
|
||||
if (!PointerIsInRingSerie(chart.series, local)) return false;
|
||||
if (m_IsEnterLegendButtom) return false;
|
||||
bool selected = false;
|
||||
|
||||
Reference in New Issue
Block a user