Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Example_Component.cs 977B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using XCharts.Runtime;
  3. namespace XCharts.Example
  4. {
  5. [DisallowMultipleComponent]
  6. //[ExecuteInEditMode]
  7. public class Example_Component : MonoBehaviour
  8. {
  9. BaseChart chart;
  10. void Awake()
  11. {
  12. chart = gameObject.GetComponent<BaseChart>();
  13. }
  14. void ModifyComponent()
  15. {
  16. var title = chart.EnsureChartComponent<Title>();
  17. title.text = "Simple LineChart";
  18. title.subText = "normal line";
  19. var serie1 = chart.AddSerie<Line>();
  20. //var serie2 = chart.GetSerie<Line>();
  21. serie1.EnsureComponent<AreaStyle>();
  22. var label = serie1.EnsureComponent<LabelStyle>();
  23. label.offset = new Vector3(0, 20, 0);
  24. var serieData = chart.AddData(0, 20);
  25. serieData.radius = 10;
  26. var itemStyle = serieData.EnsureComponent<ItemStyle>();
  27. itemStyle.color = Color.blue;
  28. }
  29. }
  30. }