2021-12-19 20:53:55 +08:00
|
|
|
using System.Collections.Generic;
|
2021-11-23 13:20:07 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2021-01-11 08:54:28 +08:00
|
|
|
{
|
2021-12-08 08:31:32 +08:00
|
|
|
public class SerieDataContext
|
|
|
|
|
{
|
2022-03-31 21:54:34 +08:00
|
|
|
public Vector3 labelPosition;
|
2022-09-08 08:00:13 +08:00
|
|
|
public Vector3 labelLinePosition;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 开始角度
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float startAngle;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 结束角度
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float toAngle;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 一半时的角度
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float halfAngle;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 当前角度
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float currentAngle;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 饼图数据项的内半径
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float insideRadius;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 饼图数据项的偏移半径
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public float offsetRadius;
|
|
|
|
|
public float outsideRadius;
|
|
|
|
|
public Vector3 position;
|
2021-12-19 20:53:55 +08:00
|
|
|
public List<Vector3> dataPoints = new List<Vector3>();
|
2022-05-31 08:17:54 +08:00
|
|
|
public List<ChartLabel> dataLabels = new List<ChartLabel>();
|
2022-03-04 22:17:32 +08:00
|
|
|
public List<SerieData> children = new List<SerieData>();
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 绘制区域。
|
|
|
|
|
/// </summary>
|
2022-03-31 21:54:34 +08:00
|
|
|
public Rect rect;
|
2022-04-18 08:20:16 +08:00
|
|
|
public Rect backgroundRect;
|
2022-03-31 21:54:34 +08:00
|
|
|
public Rect subRect;
|
|
|
|
|
public int level;
|
|
|
|
|
public SerieData parent;
|
|
|
|
|
public Color32 color;
|
|
|
|
|
public double area;
|
|
|
|
|
public float angle;
|
|
|
|
|
public Vector3 offsetCenter;
|
2022-05-04 08:45:19 +08:00
|
|
|
public Vector3 areaCenter;
|
2022-03-31 21:54:34 +08:00
|
|
|
public float stackHeight;
|
|
|
|
|
public bool isClip;
|
2021-12-31 13:00:17 +08:00
|
|
|
public bool canShowLabel = true;
|
2022-03-31 21:54:34 +08:00
|
|
|
public Image symbol;
|
2021-12-09 07:12:15 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the data item is highlighted.
|
2022-03-24 08:37:06 +08:00
|
|
|
/// |该数据项是否被高亮,一般由鼠标悬停或图例悬停触发高亮。
|
2021-12-09 07:12:15 +08:00
|
|
|
/// </summary>
|
2022-05-22 22:17:38 +08:00
|
|
|
public bool highlight
|
|
|
|
|
{
|
|
|
|
|
get { return m_Highligth; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
m_Highligth = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private bool m_Highligth;
|
2022-05-04 08:45:19 +08:00
|
|
|
public bool selected;
|
2022-04-13 13:26:46 +08:00
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
{
|
|
|
|
|
canShowLabel = true;
|
|
|
|
|
highlight = false;
|
|
|
|
|
parent = null;
|
|
|
|
|
symbol = null;
|
|
|
|
|
rect = Rect.zero;
|
|
|
|
|
subRect = Rect.zero;
|
|
|
|
|
children.Clear();
|
|
|
|
|
dataPoints.Clear();
|
2022-05-31 08:17:54 +08:00
|
|
|
dataLabels.Clear();
|
2022-04-13 13:26:46 +08:00
|
|
|
}
|
2021-12-08 08:31:32 +08:00
|
|
|
}
|
2021-01-11 08:54:28 +08:00
|
|
|
}
|