Files
ZHGD_Web/SelfPackages/XCharts/Examples/Example50_Scatter.cs

29 lines
669 B
C#
Raw Normal View History

2025-07-13 23:16:20 +08:00
using System;
using System.Collections.Generic;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Example
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example50_Scatter : MonoBehaviour
{
private ScatterChart chart;
void Awake()
{
chart = gameObject.GetComponent<ScatterChart>();
if (chart == null) return;
foreach (var serie in chart.series)
{
serie.symbol.sizeFunction = SymbolSize;
}
}
float SymbolSize(List<double> data)
{
return (float) (Math.Sqrt(data[2]) / 6e2);
}
}
}