2021-12-24 13:33:09 +08:00
|
|
|
|
|
2021-11-28 20:31:41 +08:00
|
|
|
|
using System.Collections.Generic;
|
2020-07-06 08:41:28 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[AddComponentMenu("XCharts/ParallelChart", 25)]
|
2020-07-06 08:41:28 +08:00
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
|
[RequireComponent(typeof(RectTransform))]
|
|
|
|
|
|
[DisallowMultipleComponent]
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public class ParallelChart : BaseChart
|
2020-07-06 08:41:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
protected override void Reset()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Reset();
|
2021-11-28 20:31:41 +08:00
|
|
|
|
RemoveData();
|
|
|
|
|
|
AddChartComponent<ParallelCoord>();
|
2021-11-23 13:20:07 +08:00
|
|
|
|
|
2021-11-28 20:31:41 +08:00
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var valueAxis = AddChartComponent<ParallelAxis>();
|
|
|
|
|
|
valueAxis.type = Axis.AxisType.Value;
|
|
|
|
|
|
}
|
|
|
|
|
|
var categoryAxis = AddChartComponent<ParallelAxis>();
|
|
|
|
|
|
categoryAxis.type = Axis.AxisType.Category;
|
|
|
|
|
|
categoryAxis.position = Axis.AxisPosition.Right;
|
|
|
|
|
|
categoryAxis.data = new List<string>() { "x1", "x2", "x3", "x4", "x5" };
|
2021-11-23 13:20:07 +08:00
|
|
|
|
|
|
|
|
|
|
Parallel.AddDefaultSerie(this, GenerateDefaultSerieName());
|
2020-07-06 08:41:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|