mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 17:30:10 +00:00
Line支持Clip
This commit is contained in:
@@ -286,8 +286,7 @@ namespace XCharts.Runtime
|
||||
|
||||
var lastDataIsIgnore = datas[0].isIgnoreBreak;
|
||||
var smooth = serie.lineType == LineType.Smooth;
|
||||
var firstInGridPointIndex = smooth && serie.clip ? -1 : 1;
|
||||
// var interactPoints = new List<Vector3>();
|
||||
var firstInGridPointIndex = serie.clip ? -1 : 1;
|
||||
for (int i = 1; i < dataCount; i++)
|
||||
{
|
||||
var cdata = datas[i];
|
||||
@@ -310,38 +309,10 @@ namespace XCharts.Runtime
|
||||
var isClip = false;
|
||||
if (serie.clip)
|
||||
{
|
||||
//if (smooth)
|
||||
{
|
||||
if (!grid.Contains(cp))
|
||||
isClip = true;
|
||||
else if (firstInGridPointIndex <= 0)
|
||||
firstInGridPointIndex = i;
|
||||
if (firstInGridPointIndex > 0 && !grid.Contains(np))
|
||||
isClip = true;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// var isLpInGrid = grid.Contains(lp);
|
||||
// var isCpInGrid = grid.Contains(cp);
|
||||
// if (!isLpInGrid || !isCpInGrid)
|
||||
// {
|
||||
// interactPoints.Clear();
|
||||
// if (grid.BoundaryPoint(lp, cp, ref interactPoints))
|
||||
// {
|
||||
// if (interactPoints.Count >= 2)
|
||||
// {
|
||||
// lp = interactPoints[0];
|
||||
// cp = interactPoints[1];
|
||||
// }
|
||||
// else if (isLpInGrid)
|
||||
// cp = interactPoints[0];
|
||||
// else
|
||||
// lp = interactPoints[0];
|
||||
// if (i == dataCount - 1)
|
||||
// np = cp;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (!grid.Contains(cp))
|
||||
isClip = true;
|
||||
else if (firstInGridPointIndex <= 0)
|
||||
firstInGridPointIndex = i;
|
||||
if (isClip) isIgnore = true;
|
||||
}
|
||||
if (!smooth)
|
||||
@@ -384,8 +355,10 @@ namespace XCharts.Runtime
|
||||
ref itp, ref ibp,
|
||||
ref clp, ref crp,
|
||||
ref bitp, ref bibp, i);
|
||||
if (i == firstInGridPointIndex)
|
||||
|
||||
if (i == 1)
|
||||
{
|
||||
if (isClip) lastDataIsIgnore = true;
|
||||
AddLineVertToVertexHelper(vh, ltp, lbp, lineColor, isVisualMapGradient, isLineStyleGradient,
|
||||
visualMap, serie.lineStyle, grid, axis, relativedAxis, false, lastDataIsIgnore, isIgnore);
|
||||
if (dataCount == 2 || isBreak)
|
||||
|
||||
@@ -839,7 +839,8 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_Large, value)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
|
||||
/// Turn on the threshold for mass optimization. Enter performance mode only when large is enabled and the amount of data is greater than the threshold.
|
||||
/// |开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
|
||||
/// </summary>
|
||||
public int largeThreshold
|
||||
{
|
||||
@@ -847,7 +848,8 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_LargeThreshold, value)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
|
||||
/// If the pie chart and labels are displayed externally, whether to enable the label overlap prevention policy is disabled by default. If labels are crowded and overlapped, the positions of labels are moved to prevent label overlap.
|
||||
/// |在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
|
||||
/// </summary>
|
||||
public bool avoidLabelOverlap
|
||||
{
|
||||
|
||||
@@ -339,8 +339,8 @@ namespace XUGL
|
||||
|
||||
if (Vector3.Cross(dir1, dir2) == Vector3.zero && np != cp)
|
||||
{
|
||||
itp = ntp;
|
||||
ibp = nbp;
|
||||
itp = clp;
|
||||
ibp = crp;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user