diff --git a/Assets/XCharts/Examples/Runtime/Example_LargeData.cs b/Assets/XCharts/Examples/Runtime/Example_LargeData.cs
index d75af752..eae5c44e 100644
--- a/Assets/XCharts/Examples/Runtime/Example_LargeData.cs
+++ b/Assets/XCharts/Examples/Runtime/Example_LargeData.cs
@@ -4,7 +4,7 @@ using UnityEngine;
namespace XCharts.Example
{
[DisallowMultipleComponent]
- [ExecuteInEditMode]
+ //[ExecuteInEditMode]
[RequireComponent(typeof(BaseChart))]
public class Example_LargeData : MonoBehaviour
{
@@ -25,21 +25,25 @@ namespace XCharts.Example
chart.GetChartComponent
().text = maxCacheDataNumber + "数据";
}
+ private double lastValue = 0d;
+
private void Update()
{
if (initCount < maxCacheDataNumber)
{
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < 20; i++)
{
initCount++;
if (initCount > maxCacheDataNumber) break;
chart.GetChartComponent().text = initCount + "数据";
-
- timeNow = timeNow.AddSeconds(1);
- float xvalue = Mathf.PI / 180 * initCount;
- float yvalue = Mathf.Sin(xvalue);
- chart.AddData(0, 15 + yvalue * 2);
+ timeNow = timeNow.AddSeconds(1);
+ if (lastValue < 20)
+ lastValue += UnityEngine.Random.Range(0, 5);
+ else
+ lastValue += UnityEngine.Random.Range(-5f, 5f);
+ chart.AddData(0, lastValue);
+
chart.AddXAxisData(timeNow.ToString("hh:mm:ss"));
}
}
diff --git a/Assets/XCharts/Runtime/Serie/Line/LineHelper.cs b/Assets/XCharts/Runtime/Serie/Line/LineHelper.cs
index 31df6a6c..9b291f16 100644
--- a/Assets/XCharts/Runtime/Serie/Line/LineHelper.cs
+++ b/Assets/XCharts/Runtime/Serie/Line/LineHelper.cs
@@ -273,7 +273,7 @@ namespace XCharts
ref ntp, ref nbp,
ref itp, ref ibp,
ref clp, ref crp,
- ref bitp, ref bibp);
+ ref bitp, ref bibp, i);
if (i == 1)
{
@@ -283,8 +283,16 @@ namespace XCharts
if (bitp == bibp)
{
- AddLineVertToVertexHelper(vh, itp, ibp, lineColor, isVisualMapGradient, isLineStyleGradient,
+ if (bitp)
+ AddLineVertToVertexHelper(vh, itp, ibp, lineColor, isVisualMapGradient, isLineStyleGradient,
+ visualMap, serie.lineStyle, grid, axis, relativedAxis, true, lastDataIsIgnore, isIgnore);
+ else
+ {
+ AddLineVertToVertexHelper(vh, ltp, clp, lineColor, isVisualMapGradient, isLineStyleGradient,
visualMap, serie.lineStyle, grid, axis, relativedAxis, true, lastDataIsIgnore, isIgnore);
+ AddLineVertToVertexHelper(vh, ltp, crp, lineColor, isVisualMapGradient, isLineStyleGradient,
+ visualMap, serie.lineStyle, grid, axis, relativedAxis, true, lastDataIsIgnore, isIgnore);
+ }
}
else
{
diff --git a/Assets/XCharts/Runtime/Serie/Line/SimplifiedLineHandler.cs b/Assets/XCharts/Runtime/Serie/Line/SimplifiedLineHandler.cs
index b8c38293..f391e7eb 100644
--- a/Assets/XCharts/Runtime/Serie/Line/SimplifiedLineHandler.cs
+++ b/Assets/XCharts/Runtime/Serie/Line/SimplifiedLineHandler.cs
@@ -1,9 +1,7 @@
using System.Collections.Generic;
-using System.Text;
using UnityEngine;
using UnityEngine.UI;
-using XUGL;
namespace XCharts
{
diff --git a/Assets/XCharts/Runtime/XUGL/UGL.cs b/Assets/XCharts/Runtime/XUGL/UGL.cs
index fd64e70d..1cba640e 100644
--- a/Assets/XCharts/Runtime/XUGL/UGL.cs
+++ b/Assets/XCharts/Runtime/XUGL/UGL.cs
@@ -1360,7 +1360,7 @@ namespace XUGL
}
else
{
- DrawTriangle(vh, realCenter, p2, p3, toColor, color, color);
+ AddVertToVertexHelper(vh, p3, realCenter, color, toColor, i > 0);
}
p2 = p3;
@@ -1628,19 +1628,28 @@ namespace XUGL
center.y + outsideRadius * Mathf.Cos(currAngle));
p4 = new Vector3(center.x + insideRadius * Mathf.Sin(currAngle),
center.y + insideRadius * Mathf.Cos(currAngle));
- if (!UGLHelper.IsClearColor(emptyColor)) DrawTriangle(vh, center, p1, p4, emptyColor);
if (isGradient)
{
var tcolor = Color32.Lerp(color, toColor, i * 1.0f / segments);
- DrawQuadrilateral(vh, p2, p3, p4, p1, tcolor, tcolor);
+ AddVertToVertexHelper(vh, p3, p4, tcolor, tcolor, i > 0);
}
else
{
- DrawQuadrilateral(vh, p2, p3, p4, p1, color, color);
+ AddVertToVertexHelper(vh, p3, p4, color, color, i > 0);
}
p1 = p4;
p2 = p3;
}
+ if (!UGLHelper.IsClearColor(emptyColor))
+ {
+ for (int i = 0; i <= segments; i++)
+ {
+ float currAngle = realStartInAngle + i * segmentAngle;
+ p4 = new Vector3(center.x + insideRadius * Mathf.Sin(currAngle),
+ center.y + insideRadius * Mathf.Cos(currAngle));
+ AddVertToVertexHelper(vh, center, p4, emptyColor, emptyColor, i > 0);
+ }
+ }
if (needBorder || needSpace || roundCap)
{
if (clockwise)
diff --git a/Assets/XCharts/Runtime/XUGL/UGLHelper.cs b/Assets/XCharts/Runtime/XUGL/UGLHelper.cs
index 856d2649..64c9efbc 100644
--- a/Assets/XCharts/Runtime/XUGL/UGLHelper.cs
+++ b/Assets/XCharts/Runtime/XUGL/UGLHelper.cs
@@ -283,7 +283,7 @@ namespace XUGL
ref Vector3 ntp, ref Vector3 nbp,
ref Vector3 itp, ref Vector3 ibp,
ref Vector3 clp, ref Vector3 crp,
- ref bool bitp, ref bool bibp
+ ref bool bitp, ref bool bibp, int debugIndex = 0
)
{
var dir1 = (cp - lp).normalized;
@@ -319,6 +319,12 @@ namespace XUGL
crp = cp + dir2v * width;
bibp = false;
}
+ if (bitp == false && bibp == false && cp == np)
+ {
+ ltp = cp - dir1v * width;
+ clp = cp + dir1v * width;
+ crp = cp + dir1v * width;
+ }
}
}
}
\ No newline at end of file