Files
XCharts/Runtime/Serie/Parallel/Parallel.cs

37 lines
1.2 KiB
C#
Raw Normal View History

2021-11-28 20:31:41 +08:00
using System.Collections.Generic;
2021-11-23 13:20:07 +08:00
using UnityEngine;
2022-02-19 22:37:57 +08:00
namespace XCharts.Runtime
2021-11-23 13:20:07 +08:00
{
[System.Serializable]
[SerieHandler(typeof(ParallelHandler), true)]
[RequireChartComponent(typeof(ParallelCoord))]
[SerieComponent(typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
2022-05-22 22:17:38 +08:00
[SerieDataExtraField()]
2021-11-23 13:20:07 +08:00
public class Parallel : Serie, INeedSerieContainer
{
public int containerIndex { get; internal set; }
public int containterInstanceId { get; internal set; }
2022-01-26 20:47:14 +08:00
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
2021-11-23 13:20:07 +08:00
{
var serie = chart.AddSerie<Parallel>(serieName);
2021-11-28 20:31:41 +08:00
serie.lineStyle.width = 0.8f;
serie.lineStyle.opacity = 0.6f;
for (int i = 0; i < 100; i++)
{
2022-05-22 22:17:38 +08:00
var data = new List<double>()
{
Random.Range(0f, 50f),
Random.Range(0f, 100f),
Random.Range(0f, 1000f),
Random.Range(0, 5),
};
2021-11-28 20:31:41 +08:00
serie.AddData(data, "data" + i);
}
chart.RefreshChart();
2022-01-26 20:47:14 +08:00
return serie;
2021-11-23 13:20:07 +08:00
}
}
}