增加EffectScatter类型的散点图

This commit is contained in:
monitor1394
2019-07-22 19:02:28 +08:00
parent 34e7a5a913
commit 74e045686a
4 changed files with 71 additions and 6 deletions

View File

@@ -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)
{

View File

@@ -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)