暫無描述
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.

ScatterChart.cs 922B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. namespace XCharts.Runtime
  3. {
  4. [AddComponentMenu("XCharts/ScatterChart", 17)]
  5. [ExecuteInEditMode]
  6. [RequireComponent(typeof(RectTransform))]
  7. [DisallowMultipleComponent]
  8. public class ScatterChart : BaseChart
  9. {
  10. protected override void DefaultChart()
  11. {
  12. AddChartComponentWhenNoExist<GridCoord>();
  13. var tooltip = GetOrAddChartComponent<Tooltip>();
  14. tooltip.type = Tooltip.Type.None;
  15. tooltip.trigger = Tooltip.Trigger.Item;
  16. var xAxis = GetOrAddChartComponent<XAxis>();
  17. xAxis.type = Axis.AxisType.Value;
  18. xAxis.boundaryGap = false;
  19. var yAxis = GetOrAddChartComponent<YAxis>();
  20. yAxis.type = Axis.AxisType.Value;
  21. yAxis.boundaryGap = false;
  22. RemoveData();
  23. Scatter.AddDefaultSerie(this, GenerateDefaultSerieName());
  24. }
  25. }
  26. }