|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ZedGraph;
using System.Threading;
namespace ZedGraphSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void zedGraphControl1_Load(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
CreateChart(zg1);
SetSize();
}
private void Form1_Resize(object sender, EventArgs e)
{
SetSize();
}
private void SetSize()
{
zg1.Location = new Point(10, 10);
// Leave a small margin around the outside of the control
zg1.Size = new Size(this.ClientRectangle.Width - 20, this.ClientRectangle.Height - 20);
}
public void CreateChart(ZedGraphControl zgc)//:public Dane * wskaznik_dane
{
GraphPane myPane = zgc.GraphPane;
// Set the title and axis labels
myPane.Title.Text = "Proba czy dzialam";
myPane.XAxis.Title.Text = "Czas";
myPane.YAxis.Title.Text = "mV";
// Make up some data arrays based on the Sine function
PointPairList list1 = new PointPairList();
PointPairList list2 = new PointPairList();
int[] tablicaLiczb = {1, 2, 3};
for (int i = 0; i < 3; i++)
{
int x = tablicaLiczb [i];
int y1 = 2;
int y2 = 3;
list1.Add(x, y1);
list2.Add(x, y2);
}
// Generate a red curve with diamond
// symbols, and "Porsche" in the legend
LineItem myCurve = myPane.AddCurve("1 wykres",
list1, Color.Red, SymbolType.Diamond);
// Generate a blue curve with circle
// symbols, and "Piper" in the legend
LineItem myCurve2 = myPane.AddCurve("2 wykres",
list2, Color.Blue, SymbolType.Circle);
// Calculate the Axis Scale Ranges
zgc.AxisChange();
}
}
}
|