Beispiel #1
0
        IEnumerator AddSimpleLine()
        {
            chart = gameObject.GetComponent <LineChart>();
            if (chart == null)
            {
                chart = gameObject.AddComponent <LineChart>();
            }
            chart.title.text    = "LineChart - 折线图";
            chart.title.subText = "普通折线图";

            chart.yAxis0.minMaxType = Axis.AxisMinMaxType.Custom;
            chart.yAxis0.min        = 0;
            chart.yAxis0.max        = 100;

            chart.RemoveData();
            serie = chart.AddSerie(SerieType.Line, "Line");

            for (int i = 0; i < m_DataNum; i++)
            {
                chart.AddXAxisData("x" + (i + 1));
                chart.AddData(0, UnityEngine.Random.Range(30, 90));
            }
            yield return(new WaitForSeconds(1));
        }