修复LineChart渐出动画绘制异常的问题#79

This commit is contained in:
monitor1394
2020-07-25 19:20:14 +08:00
parent d17a306f7c
commit 87d7668768
5 changed files with 16 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
# 更新日志
* (2020.07.25) Fixed problem with gradual discoloration on `LiquidChart` at `100%`#80
* (2020.07.25) Fixed a problem with `LineChart` emerging abnormal in animation drawing#79
* (2020.07.25) Fixed a problem with gradual discoloration on `LiquidChart` at `100%`#80
* (2020.07.25) Added `RadarChart` support for `formatter` of `Tooltip`#77
* (2020.07.23) Added `RingChart` ring gradient support#75
* (2020.07.21) Added `formatter` of `AxisLabel` and `SerieLabel` to configure numeric formatting separately.

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2020.07.25) 修复`LineChart`渐出动画绘制异常的问题#79
* (2020.07.25) 修复`LiquidChart``100%`时渐变色会失效的问题#80
* (2020.07.25) 增加`RadarChart``Tooltip``formatter`支持#77
* (2020.07.23) 增加`RingChart`环形渐变支持#75

View File

@@ -279,6 +279,11 @@ namespace XCharts
return !m_Enable || m_IsEnd || (m_CurrDataProgress > m_DestDataProgress && m_CurrDetailProgress > m_DestDetailProgress);
}
public bool IsInFadeOut()
{
return m_FadeOut;
}
public bool IsInDelay()
{
if (m_FadeOut) return (fadeOutDelay > 0 && Time.time - startTime < fadeOutDelay / 1000);

View File

@@ -276,7 +276,7 @@ namespace XCharts
var serieData = serie.data[n];
var xdata = serieData.GetData(0, xAxis.inverse);
var ydata = serieData.GetData(1, yAxis.inverse);
var symbol = SerieHelper.GetSerieSymbol(serie,serieData);
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)
@@ -1406,7 +1406,7 @@ namespace XCharts
if (serieData.labelObject == null) continue;
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData, serieData.highlighted);
serieData.index = j;
if ((serieLabel.show || serieData.iconStyle.show))
if ((serieLabel.show || serieData.iconStyle.show) && j < serie.dataPoints.Count)
{
var pos = serie.dataPoints[j];

View File

@@ -1116,8 +1116,11 @@ namespace XCharts
{
if (smoothStartPosDn != Vector3.zero && smoothStartPosUp != Vector3.zero)
{
CheckClipAndDrawTriangle(vh, smoothStartPosUp, startUp, lp, lineColor, serie.clip);
CheckClipAndDrawTriangle(vh, smoothStartPosDn, startDn, lp, lineColor, serie.clip);
if (!serie.animation.IsInFadeOut())
{
CheckClipAndDrawTriangle(vh, smoothStartPosUp, startUp, lp, lineColor, serie.clip);
CheckClipAndDrawTriangle(vh, smoothStartPosDn, startDn, lp, lineColor, serie.clip);
}
smoothPoints.Add(smoothStartPosUp);
smoothDownPoints.Add(smoothStartPosDn);
}
@@ -1352,6 +1355,7 @@ namespace XCharts
for (int i = 1; i < linePointList.Count; i++)
{
ep = linePointList[i];
if (serie.animation.CheckDetailBreak(ep, isYAxis)) return false;
CheckClipAndDrawLine(vh, sp, ep, lineWidth, lineColor, serie.clip);
sp = ep;
}