2021-11-28 20:31:41 +08:00
|
|
|
using System.Collections.Generic;
|
2020-07-06 08:41:28 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2020-07-06 08:41:28 +08:00
|
|
|
{
|
2024-01-13 22:37:13 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// Parallel Coordinates is a common way of visualizing high-dimensional geometry and analyzing multivariate data.
|
|
|
|
|
/// || 平行坐标系,通过绘制垂直于坐标轴的平行线来显示数据的一种可视化图表。
|
|
|
|
|
/// </summary>
|
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]
|
2023-06-04 21:52:23 +08:00
|
|
|
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
|
2021-11-23 13:20:07 +08:00
|
|
|
public class ParallelChart : BaseChart
|
2020-07-06 08:41:28 +08:00
|
|
|
{
|
2022-03-20 18:52:50 +08:00
|
|
|
protected override void DefaultChart()
|
2020-07-06 08:41:28 +08:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
}
|
2022-05-22 22:17:38 +08:00
|
|
|
}
|