mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 10:20:10 +00:00
增加SerieData可单独设置SerieSymbol#66
This commit is contained in:
@@ -276,7 +276,8 @@ namespace XCharts
|
||||
var serieData = serie.data[n];
|
||||
var xdata = serieData.GetData(0, xAxis.inverse);
|
||||
var ydata = serieData.GetData(1, yAxis.inverse);
|
||||
var symbolSize = serie.symbol.GetSize(serieData == null ? null : serieData.data);
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie,serieData);
|
||||
var symbolSize = symbol.GetSize(serieData == null ? null : serieData.data);
|
||||
if (Mathf.Abs(xValue - xdata) / xRate < symbolSize
|
||||
&& Mathf.Abs(yValue - ydata) / yRate < symbolSize)
|
||||
{
|
||||
|
||||
@@ -21,31 +21,30 @@ namespace XCharts
|
||||
for (int n = 0; n < m_Series.Count; n++)
|
||||
{
|
||||
var serie = m_Series.GetSerie(n);
|
||||
if (serie.IsPerformanceMode()) continue;
|
||||
if (!serie.show || serie.IsPerformanceMode()) continue;
|
||||
if (serie.type != SerieType.Line) continue;
|
||||
if (!serie.show || serie.symbol.type == SerieSymbolType.None) continue;
|
||||
var count = serie.dataPoints.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!serie.symbol.ShowSymbol(i, count)) continue;
|
||||
var serieData = serie.GetSerieData(i);
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
if (!symbol.show || !symbol.ShowSymbol(i, count)) continue;
|
||||
if (serie.lineArrow.show)
|
||||
{
|
||||
if (serie.lineArrow.position == LineArrow.Position.Start && i == 0) continue;
|
||||
if (serie.lineArrow.position == LineArrow.Position.End && i == count - 1) continue;
|
||||
}
|
||||
Vector3 p = serie.dataPoints[i];
|
||||
var serieData = serie.GetSerieData(i);
|
||||
if (ChartHelper.IsIngore(p)) continue;
|
||||
if (ChartHelper.IsIngore(serie.dataPoints[i])) continue;
|
||||
bool highlight = (m_Tooltip.show && m_Tooltip.IsSelected(i))
|
||||
|| serie.data[i].highlighted || serie.highlighted;
|
||||
float symbolSize = highlight ? serie.symbol.selectedSize : serie.symbol.size;
|
||||
float symbolSize = highlight ? symbol.selectedSize : symbol.size;
|
||||
var symbolColor = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, n, highlight);
|
||||
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, m_ThemeInfo, n, highlight);
|
||||
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, highlight);
|
||||
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, highlight);
|
||||
symbolSize = serie.animation.GetSysmbolSize(symbolSize);
|
||||
CheckClipAndDrawSymbol(vh, serie.symbol.type, symbolSize, symbolBorder, p, symbolColor,
|
||||
symbolToColor, serie.symbol.gap, clip, cornerRadius);
|
||||
CheckClipAndDrawSymbol(vh, symbol.type, symbolSize, symbolBorder, serie.dataPoints[i], symbolColor,
|
||||
symbolToColor, symbol.gap, clip, cornerRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace XCharts
|
||||
for (int n = serie.minShow; n < maxCount; n++)
|
||||
{
|
||||
var serieData = serie.GetDataList(m_DataZoom)[n];
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
if (!symbol.ShowSymbol(n, maxCount)) continue;
|
||||
var highlight = serie.highlighted || serieData.highlighted;
|
||||
var color = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, colorIndex, highlight);
|
||||
var toColor = SerieHelper.GetItemToColor(serie, serieData, m_ThemeInfo, colorIndex, highlight);
|
||||
@@ -47,27 +49,27 @@ namespace XCharts
|
||||
float symbolSize = 0;
|
||||
if (serie.highlighted || serieData.highlighted)
|
||||
{
|
||||
symbolSize = serie.symbol.GetSelectedSize(datas);
|
||||
symbolSize = symbol.GetSelectedSize(datas);
|
||||
}
|
||||
else
|
||||
{
|
||||
symbolSize = serie.symbol.GetSize(datas);
|
||||
symbolSize = symbol.GetSize(datas);
|
||||
}
|
||||
symbolSize *= rate;
|
||||
if (symbolSize > 100) symbolSize = 100;
|
||||
if (serie.type == SerieType.EffectScatter)
|
||||
{
|
||||
for (int count = 0; count < serie.symbol.animationSize.Count; count++)
|
||||
for (int count = 0; count < symbol.animationSize.Count; count++)
|
||||
{
|
||||
var nowSize = serie.symbol.animationSize[count];
|
||||
var nowSize = symbol.animationSize[count];
|
||||
color.a = (symbolSize - nowSize) / symbolSize;
|
||||
DrawSymbol(vh, serie.symbol.type, nowSize, symbolBorder, pos, color, toColor, serie.symbol.gap, cornerRadius);
|
||||
DrawSymbol(vh, symbol.type, nowSize, symbolBorder, pos, color, toColor, symbol.gap, cornerRadius);
|
||||
}
|
||||
RefreshChart();
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSymbol(vh, serie.symbol.type, symbolSize, symbolBorder, pos, color, toColor, serie.symbol.gap, cornerRadius);
|
||||
DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, pos, color, toColor, symbol.gap, cornerRadius);
|
||||
}
|
||||
}
|
||||
if (!serie.animation.IsFinish())
|
||||
|
||||
@@ -171,6 +171,12 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)
|
||||
{
|
||||
if (!serie.IsPerformanceMode() && serieData.enableSymbol) return serieData.symbol;
|
||||
else return serie.symbol;
|
||||
}
|
||||
|
||||
public static Color GetAreaColor(Serie serie, ThemeInfo theme, int index, bool highlight)
|
||||
{
|
||||
var areaStyle = serie.areaStyle;
|
||||
|
||||
Reference in New Issue
Block a user