-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmGraph.cs
97 lines (61 loc) · 2.32 KB
/
frmGraph.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Demo1
{
public partial class frmGraph : Form
{
/*
* public frmGraph(List<PathPoint> pathList, string layerName)
{
*
*
* */
public static List<string> lname;
public frmGraph(Dictionary<int, List<PathPoint>> ssv,List<String> sss )
{
InitializeComponent();
//Creating an empty list
List<PathPoint> pathList = null;
var extrele = new List<PathPoint>();
//populating the graph with lots of points
for (int l = 0; l < ssv.Count ; l++)
{
var vall = ssv.ElementAt(l);
var exe = vall.Value;
pathList = exe;
double[] distanceArray = new double[pathList.Count];
double[] elevationArray = new double[pathList.Count];
for (int i = 0; i <= pathList.Count - 1; i++)
{
distanceArray[i] = pathList[i].Distance;
elevationArray[i] = pathList[i].Elevation;
}
//Creating the Zed Graph, the settings are are also mentioned here
ZedGraph.LineItem myCurve = zedGraphControl1.GraphPane.AddCurve(sss[l], distanceArray, elevationArray, Color.Blue);
myCurve.Line.Width = 1f;
myCurve.Symbol.Type = ZedGraph.SymbolType.HDash;
}
zedGraphControl1.GraphPane.Title = "Soil Profile";
zedGraphControl1.GraphPane.XAxis.Title = "Distance (meters)";
zedGraphControl1.GraphPane.YAxis.Title = "Depth (meters)";
//populate the graph
//create the distance and elevation arrays..
// zedGraphControl1.GraphPane.CurveList.Clear();
//refresh the graph
zedGraphControl1.AxisChange();
}
private void frmGraph_Load(object sender, EventArgs e)
{
}
private void zedGraphControl1_Load(object sender, EventArgs e)
{
}
}
}