Beispiel #1
0
        public override void Draw(DeviceContext context, int index)
        {
            switch (index)
            {
            case 0:
                //Relay Debug Component Update
                if (_displayInfo.Visible)
                {
                    _displayInfo.Draw(context, 0);
                }
                if (_fps.Visible)
                {
                    _fps.Draw(context, 0);
                }
                break;

            case 1:     // Draw After The Gui
                //Draw only if the component is visible and has the focus
                if (_game.ComponentsPerfMonitor.Updatable && _mainControl.Dpc != null && _mainControl.Dpc.Parent != null && _mainControl.Dpc.Parent.Parent != null)
                {
                    if (_mainControl.DebugWindow.Children[0] == _mainControl.Dpc)
                    {
                        _chart.ScreenPosition = new SharpDX.Rectangle((int)_mainControl.DebugWindow.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Left.Offset + 10,
                                                                      (int)_engine.ViewPort.Height - (int)_mainControl.DebugWindow.Bounds.Bottom.Offset + 10,
                                                                      (int)_mainControl.DebugWindow.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Left.Offset + (int)_mainControl.Dpc.Bounds.Size.X.Offset - 10,
                                                                      (int)_engine.ViewPort.Height - (int)_mainControl.DebugWindow.Bounds.Bottom.Offset + 150);

                        _chart.Draw(context, 0);
                    }
                }

                break;
            }
        }
Beispiel #2
0
        private void InitChart()
        {
            chart1 = new ColumnChart(300, 62, 45, 20);
            chart2 = new ColumnChart(300, 62, 45, 20);

            for (int i = 0; i < 13; i++)
            {
                chart1.Add(new Column(0, ((char)(i + 'a')).ToString()));
                chart2.Add(new Column(0, ((char)(i + 'a' + 13)).ToString()));
            }

            ColumnChart.Link(chart1, chart2);

            chart1.Draw(UpperChart);
            chart2.Draw(LowerChart);
        }
Beispiel #3
0
        private void UpdateChart()
        {
            int[] letters = new int[26];
            foreach (char c in InputField_LetterFrequency_TextBox.Text)
            {
                if (!char.IsLetter(c))
                {
                    continue;
                }
                letters[c - 'a']++;
            }

            for (int i = 0; i < 13; i++)
            {
                chart1.updateColumnByName(((char)(i + 'a')).ToString(), letters[i]);
                chart2.updateColumnByName(((char)(i + 'a' + 13)).ToString(), letters[i + 13]);
            }

            ColumnChart.Link(chart1, chart2);
            chart1.Draw(UpperChart);
            chart2.Draw(LowerChart);
        }