Пример #1
0
 private void GraphPanel_Paint(object sender, PaintEventArgs e)
 {
     graph = GraphPanel.CreateGraphics();
     graph.Clear(GraphPanel.BackColor);
     offset = 10 - scrollOffset;
     foreach (var element in Statistics.OrderByDescending(x => x.Value))
     {
         graph.FillRectangle(brush, offset, 50, LetterWidth / 2, FullColumnHeight * Convert.ToSingle(element.Value));
         offset += LetterWidth;
     }
 }
Пример #2
0
 private void ShowStatistics()
 {
     GraphPanel.Controls.Clear();
     graph  = GraphPanel.CreateGraphics();
     offset = 10;
     foreach (var element in Statistics.OrderByDescending(x => x.Value))
     {
         Label l = new Label();
         l.Text     = element.Key + "";
         l.Location = new Point(offset, l.Location.Y);
         l.Width    = LetterWidth;
         GraphPanel.Controls.Add(l);
         graph.FillRectangle(brush, offset, 50, LetterWidth / 2, FullColumnHeight * Convert.ToSingle(element.Value));
         offset += LetterWidth;
     }
 }
Пример #3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (_points.Count == 0)
            {
                return;
            }

            var graphics = GraphPanel.CreateGraphics();

            graphics.Clear(Color.White);

            DrawGrid(graphics);
            DrawFunction(graphics);

            base.OnPaint(e);
        }
Пример #4
0
 public RayPad()
 {
     InitializeComponent();
     draw_graph = GraphPanel.CreateGraphics();
 }