private void panel1_Paint(object sender, PaintEventArgs e) { if (_pie == null) return; Rectangle rect = new Rectangle(_x - _radius, _y - _radius, _x + _radius, _y + _radius); _selected = _pie.Draw(e.Graphics, rect, _mx, _my); }
int BySize(Datum x, Datum y) { if (x.Value > y.Value) return 1; if (x.Value == y.Value) return String.CompareOrdinal(x.Name, y.Name); return -1; }
void DrawTitle(Graphics g, Rectangle rect, Datum d) { int x = rect.Right + 16; int y = rect.Top; g.DrawString(_title + " " + _total, _font, Brushes.DarkGray, x, y); y += 20; g.DrawString(d.Name, _font, Brushes.DarkGray, x, y); y += 20; g.DrawString(d.Value.ToString() + " (" + (int)(d.Value*100/_total)+ "%)", _font, Brushes.DarkGray, x, y); }
Brush GetBrush(Datum d) { return d.Brush; }