2021-01-11 08:54:28 +08:00
|
|
|
|
/************************************************/
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Copyright (c) 2018 - 2021 monitor1394 */
|
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/************************************************/
|
2019-10-22 04:09:04 +08:00
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
using System;
|
2019-10-22 04:09:04 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
2020-05-15 06:52:40 +08:00
|
|
|
|
namespace XCharts.Examples
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
[DisallowMultipleComponent]
|
|
|
|
|
|
[ExecuteInEditMode]
|
2020-05-15 06:52:40 +08:00
|
|
|
|
public class Example50_Scatter : MonoBehaviour
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
private ScatterChart chart;
|
|
|
|
|
|
|
|
|
|
|
|
void Awake()
|
|
|
|
|
|
{
|
|
|
|
|
|
chart = gameObject.GetComponent<ScatterChart>();
|
|
|
|
|
|
if (chart == null) return;
|
|
|
|
|
|
chart.series.SetSerieSymbolSizeCallback(SymbolSize, SymbolSelectedSize);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
float SymbolSize(List<double> data)
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
return (float)(Math.Sqrt(data[2]) / 6e2);
|
2019-10-22 04:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
float SymbolSelectedSize(List<double> data)
|
2019-10-22 04:09:04 +08:00
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
return (float)(Math.Sqrt(data[2]) / 5e2);
|
2019-10-22 04:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|