示例#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();
 }