Exemplo n.º 1
0
        private static void ExportRadarChart(StringBuilder sb, RadarChart chart)
        {
            var instanceId = chart.GetInstanceID();

            for (int i = 0; i < chart.radars.Count; i++)
            {
                var radar = chart.radars[i];
                AppendColor(sb, instanceId, "radarSplitLine_" + i, radar.splitLine.lineStyle.color);
                AppendColor(sb, instanceId, "radarSplitArea_" + i, radar.splitArea.color);
            }
            ExportSeries(sb, chart);
        }
Exemplo n.º 2
0
        IEnumerator RadarAdd()
        {
            chart = gameObject.GetComponent <RadarChart>();
            if (chart == null)
            {
                chart = gameObject.AddComponent <RadarChart>();
            }
            chart.RemoveRadar();
            chart.RemoveData();

            chart.title.text    = "RadarChart - 雷达图";
            chart.title.subText = "";

            chart.legend.show           = true;
            chart.legend.location.align = Location.Align.TopLeft;
            chart.legend.location.top   = 60;
            chart.legend.location.left  = 2;
            chart.legend.itemWidth      = 70;
            chart.legend.itemHeight     = 20;
            chart.legend.orient         = Orient.Vertical;

            chart.AddRadar(Radar.Shape.Polygon, new Vector2(0.5f, 0.4f), 0.4f);
            chart.AddIndicator(0, "indicator1", 0, 100);
            chart.AddIndicator(0, "indicator2", 0, 100);
            chart.AddIndicator(0, "indicator3", 0, 100);
            chart.AddIndicator(0, "indicator4", 0, 100);
            chart.AddIndicator(0, "indicator5", 0, 100);

            serie            = chart.AddSerie(SerieType.Pie, "test");
            serie.radarIndex = 0;
            chart.AddData(0, new List <float> {
                10, 20, 60, 40, 20
            }, "data1");
            chart.AddData(0, new List <float> {
                40, 60, 90, 80, 70
            }, "data2");
            yield return(new WaitForSeconds(1));
        }