title: Creating Pie/Bar Graphics using Class Library
body: <p>I want to create a class library which is able to draw pie or bar chart.
  i'm using following codes...</p>
  
  <pre><code>Graphics g = CreateGraphics();
  </code></pre>
  
  <p>when i used that code visual studio told me you cant use with dll files(Class Library).</p>
  
  <p>i've still problem how can i fix that... o_O</p>
  
  <p>asking more information:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Drawing;
  using System.Data;
  
  
  namespace KouChart
  {
      public class Pasta
      {
          public void PastaCiz(int a, int b, int c)
          {
              float toplam = a + b + c;
              float deg1 = (a / toplam) * 360;
              float deg2 = (b / toplam) * 360;
              float deg3 = (c / toplam) * 360;
              Pen p = new Pen(Color.Red, 2);
              Graphics g = this.CreateGraphics();
              Rectangle rec = new Rectangle(50, 12, 150, 150);
              Brush b1 = new SolidBrush(Color.Red);
              Brush b2 = new SolidBrush(Color.Black);
              Brush b3 = new SolidBrush(Color.Blue);
              Brush b4 = new SolidBrush(Color.Yellow);
  
              g.DrawPie(p, rec, 0, deg1);
              g.FillPie(b1, rec, 0, deg1);
              g.DrawPie(p, rec, deg1, deg2);
              g.FillPie(b2, rec, deg1, deg2);
              g.DrawPie(p, rec, deg2 + deg1, deg3);
              g.FillPie(b3, rec, deg2 + deg1, deg3);
          }
      }
  }
  </code></pre>
  
  <p>and errors: Error   1   'KouChart.Pasta' does not contain a definition for 'CreateGraphics' and no extension method 'CreateGraphics' accepting a first argument of type 'KouChart.Pasta' could be found (are you missing a using directive or an assembly reference?)   C:\Users\Muyu\Documents\Visual Studio 2010\Projects\KouChart\KouChart\Pasta.cs  20  31  KouChart</p>