3.0 - optimize code

This commit is contained in:
monitor1394
2022-03-04 22:17:32 +08:00
parent 1ee0df09eb
commit 5745fea9a1
59 changed files with 482 additions and 435 deletions

View File

@@ -20,9 +20,9 @@ namespace XCharts.Example
var serie = chart.GetSerie(0);
serie.animation.enable = true;
//自定义每个数据项的渐入延时
serie.animation.customFadeInDelay = CustomFadeInDelay;
serie.animation.fadeInDelayFunction = CustomFadeInDelay;
//自定义每个数据项的渐入时长
serie.animation.customFadeInDuration = CustomFadeInDuration;
serie.animation.fadeInDurationFunction = CustomFadeInDuration;
}
float CustomFadeInDelay(int dataIndex)

View File

@@ -17,15 +17,15 @@ namespace XCharts.Example
chart = gameObject.GetComponent<LineChart>();
if (chart == null) return;
chart.onCustomDraw = delegate (VertexHelper vh)
chart.onDraw = delegate (VertexHelper vh)
{
};
// or
chart.onCustomDrawBeforeSerie = delegate (VertexHelper vh, Serie serie)
chart.onDrawBeforeSerie = delegate (VertexHelper vh, Serie serie)
{
};
// or
chart.onCustomDrawAfterSerie = delegate (VertexHelper vh, Serie serie)
chart.onDrawAfterSerie = delegate (VertexHelper vh, Serie serie)
{
if (serie.index != 0) return;
var dataPoints = serie.context.dataPoints;
@@ -41,7 +41,7 @@ namespace XCharts.Example
}
};
// or
chart.onCustomDrawTop = delegate (VertexHelper vh)
chart.onDrawTop = delegate (VertexHelper vh)
{
};
}

View File

@@ -114,7 +114,7 @@ namespace XCharts.Example
chart.RefreshChart();
yield return null;
}
serie.pieSpace = 1f;
serie.gap = 1f;
chart.RefreshChart();
yield return new WaitForSeconds(1);
@@ -122,7 +122,7 @@ namespace XCharts.Example
chart.RefreshChart();
yield return new WaitForSeconds(1);
serie.pieSpace = 0f;
serie.gap = 0f;
serie.data[0].selected = false;
chart.RefreshChart();
yield return new WaitForSeconds(1);

View File

@@ -18,8 +18,8 @@ namespace XCharts.Example
if (chart == null) return;
foreach (var serie in chart.series)
{
serie.symbol.sizeCallback = SymbolSize;
serie.symbol.selectedSizeCallback = SymbolSelectedSize;
serie.symbol.sizeFunction = SymbolSize;
serie.symbol.selectedSizeFunction = SymbolSelectedSize;
}
}