3.0 - polar chart

This commit is contained in:
monitor1394
2022-01-26 20:47:14 +08:00
parent a32f5f5bcf
commit cc4ee3735c
41 changed files with 566 additions and 165 deletions

View File

@@ -12,12 +12,11 @@ namespace XCharts
[ComponentHandler(typeof(AngleAxisHandler), true)]
public class AngleAxis : Axis
{
[SerializeField] private float m_StartAngle = 90;
[SerializeField] private float m_StartAngle = 0;
/// <summary>
/// Starting angle of axis. 90 degrees by default, standing for top position of center.
/// 0 degree stands for right position of center.
/// 起始刻度的角度,默认为 90 度即圆心的正上方。0 度为圆心的正右方。
/// Starting angle of axis. 0 degrees by default, standing for right position of center.
/// 起始刻度的角度,默认为 0 度,即圆心的正右方。
/// </summary>
public float startAngle
{
@@ -25,12 +24,17 @@ namespace XCharts
set { if (PropertyUtil.SetStruct(ref m_StartAngle, value)) SetAllDirty(); }
}
public float GetValueAngle(float value)
{
return (value + context.startAngle + 360) % 360;
}
public override void SetDefaultValue()
{
m_Show = true;
m_Type = AxisType.Value;
m_SplitNumber = 12;
m_StartAngle = 90;
m_StartAngle = 0;
m_BoundaryGap = false;
m_Data = new List<string>(12);
splitLine.show = true;