mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 14:00:12 +00:00
3.0 - unitypackage
This commit is contained in:
34
Runtime/Chart/ParallelChart.cs
Normal file
34
Runtime/Chart/ParallelChart.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
[AddComponentMenu("XCharts/ParallelChart", 25)]
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(RectTransform))]
|
||||
[DisallowMultipleComponent]
|
||||
public class ParallelChart : BaseChart
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
protected override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
RemoveData();
|
||||
AddChartComponent<ParallelCoord>();
|
||||
|
||||
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" };
|
||||
|
||||
Parallel.AddDefaultSerie(this, GenerateDefaultSerieName());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user