mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 05:08:48 +00:00
3.0 - unitypackage
This commit is contained in:
32
Runtime/Serie/Radar/Radar.cs
Normal file
32
Runtime/Serie/Radar/Radar.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
[System.Serializable]
|
||||
[SerieHandler(typeof(RadarHandler), true)]
|
||||
[RequireChartComponent(typeof(RadarCoord))]
|
||||
[SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(AreaStyle), typeof(Emphasis))]
|
||||
public class Radar : Serie, INeedSerieContainer
|
||||
{
|
||||
public int containerIndex { get; internal set; }
|
||||
public int containterInstanceId { get; internal set; }
|
||||
|
||||
public override bool useDataNameForColor { get { return true; } }
|
||||
public static void AddDefaultSerie(BaseChart chart, string serieName)
|
||||
{
|
||||
chart.AddChartComponentWhenNoExist<RadarCoord>();
|
||||
var serie = chart.AddSerie<Radar>(serieName);
|
||||
serie.symbol.show = true;
|
||||
serie.symbol.type = SymbolType.Circle;
|
||||
serie.showDataName = true;
|
||||
List<double> data = new List<double>();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
data.Add(Random.Range(20, 90));
|
||||
}
|
||||
chart.AddData(serie.index, data, "legendName");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user