Как установить ZedGraph - C#
Формулировка задачи:
Здравствуйте!
Чтото я никак не пойму, как установить ZedGraph ? и надо ли его вообше устанавливать или нужно просто подключить к проекту? я скачал с оф. сайта исходники.
Заранее всем спасибо!
Решение задачи: «Как установить ZedGraph»
textual
Листинг программы
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ZedGraphControl zedGraph = new ZedGraphControl();
zedGraph.Location = new System.Drawing.Point(400, 400);
zedGraph.Name = "zedGraph";
zedGraph.Size = new System.Drawing.Size(100, 100);
this.Controls.Add(zedGraph);
CreateGraph(zedGraph);
}
private static void CreateGraph(ZedGraphControl zgc)
{
GraphPane myPane = zgc.GraphPane;
// Set the titles and axis labels
myPane.Title.Text = "Axis Cross Demo";
myPane.XAxis.Title.Text = "My X Axis";
myPane.YAxis.Title.Text = "My Y Axis";
// Make up some data arrays based on the Sine function
double x, y;
PointPairList list = new PointPairList();
for (int i = 0; i < 37; i++)
{
x = ((double)i - 18.0) / 5.0;
y = x * x + 1.0;
list.Add(x, y);
}
// Generate a red curve with diamond
// symbols, and "Porsche" in the legend
LineItem myCurve = myPane.AddCurve("Parabola",
list, Color.Green, SymbolType.Diamond);
// Set the Y axis intersect the X axis at an X value of 0.0
myPane.YAxis.Cross = 0.0;
// Turn off the axis frame and all the opposite side tics
myPane.Chart.Border.IsVisible = false;
myPane.XAxis.MajorTic.IsOpposite = false;
myPane.XAxis.MinorTic.IsOpposite = false;
myPane.YAxis.MajorTic.IsOpposite = false;
myPane.YAxis.MinorTic.IsOpposite = false;
// Calculate the Axis Scale Ranges
zgc.AxisChange();
zgc.Refresh();
}
}
}