C# GRAFİK OLUŞTURMA
Grafik oluşturtma
Name= ogrenci
ChartType değiştir
double oy1, oy2, oy3, oy4;
oy1 = Convert.ToDouble(textBox1.Text);
oy2 = Convert.ToDouble(textBox2.Text);
oy3 = Convert.ToDouble(textBox3.Text);
oy4 = Convert.ToDouble(textBox4.Text);
//Point leri temizleme.
foreach (var series in chart1.Series)
{
series.Points.Clear();
}
//Grafiğe değer ekleme
chart1.Series["OGRENCI"].Points.Add(oy1);
chart1.Series["OGRENCI"].Points.Add(oy2);
chart1.Series["OGRENCI"].Points.Add(oy3);
chart1.Series["OGRENCI"].Points.Add(oy4);
//x ekseninde öğrenci isimlerini belirleme
chart1.Series["OGRENCI"].Points[0].AxisLabel = label1.Text;
chart1.Series["OGRENCI"].Points[1].AxisLabel = label2.Text;
chart1.Series["OGRENCI"].Points[2].AxisLabel = label3.Text;
chart1.Series["OGRENCI"].Points[3].AxisLabel = label4.Text;
//Sütun renklerini belirleme
chart1.Series["OGRENCI"].Points[0].Color = Color.Aqua;
chart1.Series["OGRENCI"].Points[1].Color = Color.Chocolate;
chart1.Series["OGRENCI"].Points[2].Color = Color.Orange;
chart1.Series["OGRENCI"].Points[3].Color = Color.RoyalBlue;
chart1.ChartAreas[0].AxisX.LabelStyle.Angle = -70; // Öğrenci isimleri Dikey
chart1.BackColor = Color.YellowGreen;//Arka Plan rengi