This repository has been archived by the owner on Apr 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aDraw.cs
81 lines (73 loc) · 2.55 KB
/
aDraw.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
using System;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;
using System.Windows.Forms.DataVisualization.Charting;
using System.IO;
using System.Collections.Generic;
namespace World_Skills_Zadatak_1
{
public partial class aDraw : Form
{
public aDraw()
{
InitializeComponent();
}
public DataTable display = new DataTable();
public DataTable import = new DataTable();
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void aDraw_FormClosed(object sender, FormClosedEventArgs e)
{
//Debug.WriteLine("waaa");
//if (Application.OpenForms.Count.Equals(0))
// Application.Exit();
}
private void aDraw_FormClosing(object sender, FormClosingEventArgs e)
{
Debug.WriteLine("wooo");
if (Application.OpenForms.Count.Equals(0))
Application.Exit();
}
private void simple()
{
foreach (DataColumn dc in import.Columns)
display.Columns.Add(dc.ColumnName);
foreach (DataRow dr in import.Rows)
{
if (dr.ItemArray[0].ToString().Length.Equals(0)) continue;
DataRow newRow = display.NewRow();
for (int i = 0; i < display.Columns.Count; i++)
{
newRow[display.Columns[i].ColumnName] = dr.ItemArray[i];
}
display.Rows.Add(newRow);
}
}
private void timer1_Tick(object sender, EventArgs e)
{
simple();
var hold = aChart.Series[0].Points.Count;
Debug.WriteLine(hold);
arrangeData();
timer1.Stop();
}
private void arrangeData()
{
for (int i = 0; i < 10; i++)
{
DataRow dr = display.Rows[i];
aChart.Series[0].ChartType = SeriesChartType.Bubble;
double x = Convert.ToDouble(dr.ItemArray[1].ToString());
double y = Convert.ToDouble(dr.ItemArray[2].ToString());
aChart.Series[0].Points.Add(x, x, y);
//DataPoint dp = new DataPoint();
//dp.XValue = x;
//dp.YValues = { x, y };
aChart.Series[0].Points[i].Label = dr.ItemArray[0].ToString();
//Debug.WriteLine(dr.ItemArray[0].ToString() + " dist: " + dr.ItemArray[1].ToString() + " mag: " + dr.ItemArray[2]);
}
}
}
}