control the data which come from CSV file
Posted: Tue May 11, 2010 4:12 pm
Good evening,
I wrote a program for create a chart with a CSV file like that :
The program which build a graph is :
But I would like to make some calculation with all the data. For example, find the first pulse and determinate the barycentre.
So , My question is : How have the values of my chart to calculate the barycentre of the first pulse ?
I wrote a program for create a chart with a CSV file like that :
Code: Select all
10 0,0
20 1,5
40 2,5
50 10
60 20
70 30
80 50
85 62,5
90 75
100 55
105 40
110 30
120 15
130 7,5
140 2,5
150 1,5
160 0,0
170 0
180 2
185 6
186 7
187 10
210 0,0
220 1,5
240 2,5
250 10
260 20
270 30
280 50
285 62,5
290 75
300 55
305 40
310 30
320 15
330 7,5
340 2,5
350 1,5
360 0,0
365 20
370 30
380 1,5
400 0,0
410 0
420 2
425 6
430 7
435 10
440 20
Code: Select all
// ************************* //
// build graph with csv file //
// ************************* //
// new fatline of steema library
FastLine fast1;
//clear the chart
tChart1.Clear();
// disable of view in 3D
this.tChart1.Aspect.View3D = false;
// title of the chart
tChart1.Header.Text = "graph build with a CSV file";
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart1.AutoRepaint = true;
fast1 = new FastLine(tChart1.Chart);
TextSource textsource1 = new TextSource("C:\\Users\\xxx\\testone.csv");
textsource1.DecimalSeparator = ',';
textsource1.Separator =Convert.ToChar("\t");
fast1.DataSource = textsource1;
textsource1.Fields.Add(0, "X");
textsource1.Fields.Add(1, "Y");
So , My question is : How have the values of my chart to calculate the barycentre of the first pulse ?