No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SerieDataContext.cs 2.4KB

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