mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 15:30:09 +00:00
增加EffectScatter类型的散点图
This commit is contained in:
@@ -176,7 +176,8 @@ namespace XCharts
|
||||
{
|
||||
var xdata = serie.xData[n];
|
||||
var ydata = serie.yData[n];
|
||||
var symbolSize = serie.symbol.GetSize(serie.data[n].data);
|
||||
var serieData = serie.GetSerieData(n);
|
||||
var symbolSize = serie.symbol.GetSize(serieData == null?null:serieData.data);
|
||||
if (Mathf.Abs(xValue - xdata) / xRate < symbolSize
|
||||
&& Mathf.Abs(yValue - ydata) / yRate < symbolSize)
|
||||
{
|
||||
|
||||
@@ -82,8 +82,13 @@ namespace XCharts
|
||||
public SymbolSizeCallback sizeCallback { get { return m_SizeCallback; } set { m_SizeCallback = value; } }
|
||||
public SymbolSizeCallback selectedSizeCallback { get { return m_SelectedSizeCallback; } set { m_SelectedSizeCallback = value; } }
|
||||
|
||||
private List<float> m_AnimationSize = new List<float>(){0,5,10};
|
||||
public List<float> animationSize { get{return m_AnimationSize;}}
|
||||
public Color animationColor { get; set; }
|
||||
|
||||
public float GetSize(List<float> data)
|
||||
{
|
||||
if(data == null) return size;
|
||||
switch (m_SizeType)
|
||||
{
|
||||
case SerieSymbolSizeType.Custom:
|
||||
@@ -106,6 +111,7 @@ namespace XCharts
|
||||
|
||||
public float GetSelectedSize(List<float> data)
|
||||
{
|
||||
if(data == null) return selectedSize;
|
||||
switch (m_SizeType)
|
||||
{
|
||||
case SerieSymbolSizeType.Custom:
|
||||
@@ -305,6 +311,15 @@ namespace XCharts
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SerieData GetSerieData(int index,DataZoom dataZoom = null){
|
||||
var data = GetDataList(dataZoom);
|
||||
if (index >= 0 && index <= data.Count - 1)
|
||||
{
|
||||
return data[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void GetXYData(int index, DataZoom dataZoom, out float xValue, out float yVlaue)
|
||||
{
|
||||
xValue = 0;
|
||||
@@ -372,6 +387,8 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void UpdateFilterData(DataZoom dataZoom)
|
||||
{
|
||||
if (dataZoom != null && dataZoom.show)
|
||||
|
||||
Reference in New Issue
Block a user