SerieDataContext.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. namespace XCharts.Runtime
  5. {
  6. public class SerieDataContext
  7. {
  8. public Vector3 labelPosition;
  9. public Vector3 labelLinePosition;
  10. public Vector3 labelLinePosition2;
  11. /// <summary>
  12. /// 开始角度
  13. /// </summary>
  14. public float startAngle;
  15. /// <summary>
  16. /// 结束角度
  17. /// </summary>
  18. public float toAngle;
  19. /// <summary>
  20. /// 一半时的角度
  21. /// </summary>
  22. public float halfAngle;
  23. /// <summary>
  24. /// 当前角度
  25. /// </summary>
  26. public float currentAngle;
  27. /// <summary>
  28. /// 饼图数据项的内半径
  29. /// </summary>
  30. public float insideRadius;
  31. /// <summary>
  32. /// 饼图数据项的偏移半径
  33. /// </summary>
  34. public float offsetRadius;
  35. public float outsideRadius;
  36. public Vector3 position;
  37. public List<Vector3> dataPoints = new List<Vector3>();
  38. public List<ChartLabel> dataLabels = new List<ChartLabel>();
  39. public List<SerieData> children = new List<SerieData>();
  40. /// <summary>
  41. /// 绘制区域。
  42. /// </summary>
  43. public Rect rect;
  44. public Rect backgroundRect;
  45. public Rect subRect;
  46. public int level;
  47. public SerieData parent;
  48. public Color32 color;
  49. public double area;
  50. public float angle;
  51. public Vector3 offsetCenter;
  52. public Vector3 areaCenter;
  53. public float stackHeight;
  54. public bool isClip;
  55. public bool canShowLabel = true;
  56. public Image symbol;
  57. /// <summary>
  58. /// Whether the data item is highlighted.
  59. /// ||该数据项是否被高亮,一般由鼠标悬停或图例悬停触发高亮。
  60. /// </summary>
  61. public bool highlight
  62. {
  63. get { return m_Highligth; }
  64. set
  65. {
  66. m_Highligth = value;
  67. }
  68. }
  69. private bool m_Highligth;
  70. public bool selected;
  71. public double inTotalValue;
  72. public double outTotalValue;
  73. public void Reset()
  74. {
  75. canShowLabel = true;
  76. highlight = false;
  77. parent = null;
  78. symbol = null;
  79. rect = Rect.zero;
  80. subRect = Rect.zero;
  81. children.Clear();
  82. dataPoints.Clear();
  83. dataLabels.Clear();
  84. }
  85. }
  86. }