Skip to content

Commit

Permalink
fix add main component error
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Mar 31, 2022
1 parent 426d437 commit 1ed0ff3
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Runtime/Component/Animation/AnimationStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ internal float CheckItemProgress(int dataIndex, float destProgress, ref bool isE
}
}

internal void CheckSymbol(float dest)
public void CheckSymbol(float dest)
{
if (!enable || m_IsEnd || m_IsPause || !m_IsInit)
return;
Expand Down
1 change: 1 addition & 0 deletions Runtime/Component/Axis/AngleAxis/AngleAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace XCharts.Runtime
/// |极坐标系的角度轴。
/// </summary>
[System.Serializable]
[RequireChartComponent(typeof(PolarCoord))]
[ComponentHandler(typeof(AngleAxisHandler), true)]
public class AngleAxis : Axis
{
Expand Down
1 change: 1 addition & 0 deletions Runtime/Component/Axis/RadiusAxis/RadiusAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace XCharts.Runtime
/// |极坐标系的径向轴。
/// </summary>
[System.Serializable]
[RequireChartComponent(typeof(PolarCoord))]
[ComponentHandler(typeof(RadiusAxisHandler), true)]
public class RadiusAxis : Axis
{
Expand Down
9 changes: 4 additions & 5 deletions Runtime/Coord/Polar/PolarCoord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace XCharts.Runtime
/// </summary>
[Serializable]
[ComponentHandler(typeof(PolarCoordHandler), true)]
[RequireChartComponent(typeof(AngleAxis), typeof(RadiusAxis))]
public class PolarCoord : CoordSystem, ISerieContainer
{
[SerializeField] private bool m_Show = true;
Expand All @@ -32,8 +31,8 @@ public bool show
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
/// <summary>
/// [default:[0.5f,0.45f]]The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate.
/// |When value between 0 and 1 represents a percentage relative to the chart.
/// The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate.
/// When value between 0 and 1 represents a percentage relative to the chart.
/// |极坐标的中心点。数组的第一项是横坐标,第二项是纵坐标。
/// 当值为0-1之间时表示百分比,设置成百分比时第一项是相对于容器宽度,第二项是相对于容器高度。
/// </summary>
Expand All @@ -43,7 +42,7 @@ public float[] center
set { if (value != null) { m_Center = value; SetAllDirty(); } }
}
/// <summary>
/// [default:0.35f]the radius of polar.
/// the radius of polar.
/// |极坐标的半径。
/// </summary>
public float radius
Expand All @@ -52,7 +51,7 @@ public float radius
set { if (PropertyUtil.SetStruct(ref m_Radius, value)) SetAllDirty(); }
}
/// <summary>
/// [default:Color.clear]Background color of polar, which is transparent by default.
/// Background color of polar, which is transparent by default.
/// |极坐标的背景色,默认透明。
/// </summary>
public Color backgroundColor
Expand Down
3 changes: 3 additions & 0 deletions Runtime/Internal/BaseChart.Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public MainComponent AddChartComponent(Type type)
AddComponent(component);
m_Components.Sort();
CreateComponentHandler(component);
#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER
UnityEditor.EditorUtility.SetDirty(this);
#endif
return component;
}

Expand Down
28 changes: 14 additions & 14 deletions Runtime/Serie/SerieContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PointInfo(Vector3 pos, bool ignore)
this.isIgnoreBreak = ignore;
}
}

public class SerieContext
{
/// <summary>
Expand All @@ -31,52 +31,52 @@ public class SerieContext
/// </summary>
public List<int> pointerAxisDataIndexs = new List<int>();
public bool isTriggerByAxis = false;

/// <summary>
/// 中心点
/// </summary>
public Vector3 center { get; internal set; }
public Vector3 center;
/// <summary>
/// 内半径
/// </summary>
public float insideRadius { get; set; }
public float insideRadius;
/// <summary>
/// 外半径
/// </summary>
public float outsideRadius { get; set; }
public float outsideRadius;
/// <summary>
/// 最大值
/// </summary>
public double dataMax { get; internal set; }
public double dataMax;
/// <summary>
/// 最小值
/// </summary>
public double dataMin { get; internal set; }
public double checkValue { get; set; }
public double dataMin;
public double checkValue;
/// <summary>
/// 左下角坐标X
/// </summary>
public float x { get; internal set; }
public float x;
/// <summary>
/// 左下角坐标Y
/// </summary>
public float y { get; internal set; }
public float y;
/// <summary>
/// 宽
/// </summary>
public float width { get; internal set; }
public float width;
/// <summary>
/// 高
/// </summary>
public float height { get; internal set; }
public float height;
/// <summary>
/// 矩形区域
/// </summary>
public Rect rect { get; internal set; }
public Rect rect;
/// <summary>
/// 绘制顶点数
/// </summary>
public int vertCount { get; internal set; }
public int vertCount;
/// <summary>
/// 数据对应的位置坐标。
/// </summary>
Expand Down
43 changes: 21 additions & 22 deletions Runtime/Serie/SerieDataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,56 @@ namespace XCharts.Runtime
{
public class SerieDataContext
{
public Vector3 labelPosition { get; set; }
public Vector3 labelPosition;
/// <summary>
/// 开始角度
/// </summary>
public float startAngle { get; internal set; }
public float startAngle;
/// <summary>
/// 结束角度
/// </summary>
public float toAngle { get; internal set; }
public float toAngle;
/// <summary>
/// 一半时的角度
/// </summary>
public float halfAngle { get; internal set; }
public float halfAngle;
/// <summary>
/// 当前角度
/// </summary>
public float currentAngle { get; internal set; }
public float currentAngle;
/// <summary>
/// 饼图数据项的内半径
/// </summary>
public float insideRadius { get; internal set; }
public float insideRadius;
/// <summary>
/// 饼图数据项的偏移半径
/// </summary>
public float offsetRadius { get; internal set; }
public float outsideRadius { get; set; }
public Vector3 position { get; set; }
public float offsetRadius;
public float outsideRadius;
public Vector3 position;
public List<Vector3> dataPoints = new List<Vector3>();
public List<SerieData> children = new List<SerieData>();

/// <summary>
/// 绘制区域。
/// </summary>
public Rect rect { get; set; }
public Rect subRect { get; set; }
public int level { get; set; }
public SerieData parent { get; set; }
public Color32 color { get; set; }
public double area { get; set; }
public float angle { get; set; }
public Vector3 offsetCenter { get; set; }
public float stackHeight { get; set; }
public bool isClip { get; set; }
public Rect rect;
public Rect subRect;
public int level;
public SerieData parent;
public Color32 color;
public double area;
public float angle;
public Vector3 offsetCenter;
public float stackHeight;
public bool isClip;

public bool canShowLabel = true;
public Image symbol { get; set; }
public Image symbol;
/// <summary>
/// Whether the data item is highlighted.
/// |该数据项是否被高亮,一般由鼠标悬停或图例悬停触发高亮。
/// </summary>
public bool highlight { get; set; }

public bool highlight;
}
}

0 comments on commit 1ed0ff3

Please sign in to comment.