public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
zedGraphControl1.GraphPane.Title.Text = "Sad se zove ovako";
zedGraphControl1.GraphPane.XAxis.Title.Text = "Nova X osa";
MessageBox.Show("Radi dugme");
}
private void SetSize()
{
zedGraphControl1.Location = new Point(308, 58);
}
private void Form1_Load(object sender, EventArgs e)
{
//postavi grafik
CreateGraph(zedGraphControl1);
SetSize();
}
private void CreateGraph(ZedGraphControl zgc)
{
GraphPane myPane = zgc.GraphPane;
//podesavanje naslova
myPane.Title.Text = "moj graf za testiranje";
myPane.XAxis.Title.Text = "X osa";
myPane.YAxis.Title.Text = "Y osa";
//nizovi podataka
double x, y1;
PointPairList list1 = new PointPairList();
for (int i = 0; i < 36; i++)
{
x = (double)i + 5;
y1 = 1.5 + Math.Sin((double)i * 0.2);
list1.Add(x, y1);
}
//crvena kriva sa dijamant tačkama
LineItem myCurve = myPane.AddCurve("porshe", list1, Color.Red, SymbolType.Circle);
myCurve.Line.IsVisible = false;
zgc.AxisChange();
}
}
}