Exemplo n.º 1
0
 protected override void Reset()
 {
     base.Reset();
     title.text   = "RingChart";
     tooltip.type = Tooltip.Type.Line;
     RemoveData();
     SerieTemplate.AddDefaultRingSerie(this, "serie1");
 }
 protected override void Reset()
 {
     base.Reset();
     title.text        = "PieChart";
     m_Legends[0].show = true;
     RemoveData();
     SerieTemplate.AddDefaultPieSerie(this, "serie1");
 }
 protected override void Reset()
 {
     base.Reset();
     RemoveData();
     m_Radars.Clear();
     title.text = "RadarChart";
     SerieTemplate.AddDefaultRadarSerie(this, "serie1");
 }
 protected override void Reset()
 {
     base.Reset();
     title.text = "LiquidChart";
     RemoveData();
     RemoveVessel();
     AddVessel(Vessel.defaultVessel);
     SerieTemplate.AddDefaultLiquidSerie(this, "serie1");
 }
Exemplo n.º 5
0
 protected override void Reset()
 {
     base.Reset();
     title.text   = "BarChart";
     tooltip.type = Tooltip.Type.Shadow;
     RemoveData();
     SerieTemplate.AddDefaultBarSerie(this, "serie1");
     for (int i = 0; i < 5; i++)
     {
         AddXAxisData("x" + (i + 1));
     }
 }
Exemplo n.º 6
0
 protected override void Reset()
 {
     base.Reset();
     title.text             = "ScatterChart";
     tooltip.type           = Tooltip.Type.None;
     m_XAxes[0].type        = Axis.AxisType.Value;
     m_XAxes[0].boundaryGap = false;
     m_YAxes[1].type        = Axis.AxisType.Value;
     m_XAxes[1].boundaryGap = false;
     RemoveData();
     SerieTemplate.AddDefaultScatterSerie(this, "serie1");
 }
        protected override void Reset()
        {
            base.Reset();
            title.text   = "CandlestickChart";
            tooltip.type = Tooltip.Type.Corss;

            RemoveData();
            var defaultDataCount = SerieTemplate.AddDefaultCandlestickSerie(this, "serie1");

            for (int i = 0; i < defaultDataCount; i++)
            {
                AddXAxisData("x" + (i + 1));
            }
        }
Exemplo n.º 8
0
        protected override void Reset()
        {
            base.Reset();
            title.text = "GanttChart";
            var xCount = 5;
            var yCount = 5;

            m_Grids[0].left        = 60;
            m_Grids[0].right       = 50;
            m_XAxes[0].type        = Axis.AxisType.Time;
            m_XAxes[0].boundaryGap = false;
            m_XAxes[0].splitNumber = xCount;
            m_YAxes[0].type        = Axis.AxisType.Category;
            m_YAxes[0].boundaryGap = true;
            m_YAxes[0].splitNumber = 0;

            RemoveData();
            SerieTemplate.AddDefaultTimeGanttSerie(this, "task", yCount);
        }
Exemplo n.º 9
0
        protected override void Reset()
        {
            base.Reset();
            title.text   = "LineChart";
            tooltip.type = Tooltip.Type.Line;

            visualMap.enable     = false;
            visualMap.show       = false;
            visualMap.autoMinMax = true;
            visualMap.inRange.Clear();
            visualMap.inRange.Add(Color.blue);
            visualMap.inRange.Add(Color.red);

            RemoveData();
            SerieTemplate.AddDefaultLineSerie(this, "serie1");
            for (int i = 0; i < 5; i++)
            {
                AddXAxisData("x" + (i + 1));
            }
        }
        private void OnGUI()
        {
            if (chart == null)
            {
                Close();
                return;
            }
            var iconRect = new Rect(5, 10, position.width - 10, EditorGUIUtility.singleLineHeight);

            serieType   = (SerieType)EditorGUI.EnumPopup(iconRect, "Serie Type", serieType);
            iconRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            serieName   = EditorGUI.TextField(iconRect, "Serie Name", serieName);
            iconRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            GUILayout.Space(iconRect.y + 5);
            if (GUILayout.Button("Add"))
            {
                SerieTemplate.AddDefaultSerie(chart, serieType, serieName);
                chart.RefreshAllComponent();
            }
        }
Exemplo n.º 11
0
        protected override void Reset()
        {
            base.Reset();
            title.text   = "HeatmapChart";
            tooltip.type = Tooltip.Type.None;
            grid.left    = 100;
            grid.right   = 60;
            grid.bottom  = 60;

            m_XAxes[0].type        = Axis.AxisType.Category;
            m_XAxes[0].boundaryGap = true;
            m_YAxes[0].type        = Axis.AxisType.Category;
            m_YAxes[0].boundaryGap = true;
            m_XAxes[0].splitNumber = 10;
            m_YAxes[0].splitNumber = 10;
            RemoveData();
            var heatmapGridWid = 10f;
            int xSplitNumber   = (int)(grid.runtimeWidth / heatmapGridWid);
            int ySplitNumber   = (int)(grid.runtimeHeight / heatmapGridWid);

            SerieTemplate.AddDefaultHeatmapSerie(this, "serie1");

            visualMap.enable          = true;
            visualMap.max             = 10;
            visualMap.range[0]        = 0f;
            visualMap.range[1]        = 10f;
            visualMap.orient          = Orient.Vertical;
            visualMap.calculable      = true;
            visualMap.location.align  = Location.Align.BottomLeft;
            visualMap.location.bottom = 100;
            visualMap.location.left   = 30;
            var colors = new List <string> {
                "#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf",
                "#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"
            };

            visualMap.inRange.Clear();
            foreach (var str in colors)
            {
                visualMap.inRange.Add(ChartTheme.GetColor(str));
            }
            for (int i = 0; i < xSplitNumber; i++)
            {
                m_XAxes[0].data.Add((i + 1).ToString());
            }
            for (int i = 0; i < ySplitNumber; i++)
            {
                m_YAxes[0].data.Add((i + 1).ToString());
            }
            for (int i = 0; i < xSplitNumber; i++)
            {
                for (int j = 0; j < ySplitNumber; j++)
                {
                    var value = 0f;
                    var rate  = Random.Range(0, 101);
                    if (rate > 70)
                    {
                        value = Random.Range(8f, 10f);
                    }
                    else
                    {
                        value = Random.Range(1f, 8f);
                    }
                    var list = new List <float> {
                        i, j, value
                    };
                    AddData(0, list);
                }
            }
        }