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; } }
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; } }
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); }
public RayPad() { InitializeComponent(); draw_graph = GraphPanel.CreateGraphics(); }