private void DrawUpDiagram(Graphics g) { Font f = new Font("Arial", 10, FontStyle.Bold); g.DrawLine(new Pen(Color.Black, 5), 30, 250, 30, 75); g.DrawLine(new Pen(Color.Black, 5), 30, 75, 20, 85); g.DrawLine(new Pen(Color.Black, 5), 30, 75, 40, 85); g.DrawLine(new Pen(Color.Black, 5), 30, 250, 700, 250); g.DrawLine(new Pen(Color.Black, 5), 700, 250, 690, 240); g.DrawLine(new Pen(Color.Black, 5), 700, 250, 690, 260); g.DrawString("V", f, Brushes.Red, 15, 45); g.DrawString("L", f, Brushes.Red, 710, 230); int max_voice = Voices.Max(), x = 0, height; for (int i = 0; i < Voices.Count; i++) { height = (Voices[i] * 150) / max_voice; g.FillRectangle(HatchBrushes[i], 50 + x, 250 - height, 40, height); x += 60; } }
private void Statistic() { textBox1.Text = $"Статистика:\r\nMax: {Voices.Max()}\r\nMin: {Voices.Min()}\r\nAvg: {Voices.Average()}"; }