Nessuna descrizione
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.

Example_Component.cs 985B

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.GetOrAddChartComponent<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.AddExtraComponent<AreaStyle>();
  22. var label = serie1.AddExtraComponent<LabelStyle>();
  23. label.offset = new Vector3(0, 20, 0);
  24. var serieData = chart.AddData(0, 20);
  25. serieData.radius = 10;
  26. var itemStyle = serieData.GetOrAddComponent<ItemStyle>();
  27. itemStyle.color = Color.blue;
  28. }
  29. }
  30. }