AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
Example50_Scatter.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System;
9 using System.Collections.Generic;
10 using UnityEngine;
11 
12 namespace XCharts.Examples
13 {
14  [DisallowMultipleComponent]
15  [ExecuteInEditMode]
16  public class Example50_Scatter : MonoBehaviour
17  {
18  private ScatterChart chart;
19 
20  void Awake()
21  {
22  chart = gameObject.GetComponent<ScatterChart>();
23  if (chart == null) return;
24  chart.series.SetSerieSymbolSizeCallback(SymbolSize, SymbolSelectedSize);
25  }
26 
27  float SymbolSize(List<double> data)
28  {
29  return (float)(Math.Sqrt(data[2]) / 6e2);
30  }
31 
32  float SymbolSelectedSize(List<double> data)
33  {
34  return (float)(Math.Sqrt(data[2]) / 5e2);
35  }
36  }
37 }
XCharts.ScatterChart
Definition: ScatterChart.cs:16
XCharts.Examples.Example50_Scatter
Definition: Example50_Scatter.cs:16
XCharts.Examples
Definition: RewardChart.cs:14