示例#1
0
 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);
 }
示例#2
0
 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;
 }
示例#3
0
        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);
        }
示例#4
0
 Brush GetBrush(Datum d)
 {
     return d.Brush;
 }