Page 1 of 1

control the data which come from CSV file

Posted: Tue May 11, 2010 4:12 pm
by 13056035
Good evening,

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

The program which build a graph is :

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");
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 ?

Re: control the data which come from CSV file

Posted: Wed May 12, 2010 3:20 pm
by yeray
Hi

I'm afraid TeeChart hasn't a barycentre function to do that for you, so you should find the peaks and calculate the barycentre manually. What I've seen here is that the barycentre seems to be related with the ternary, one of TeeChart's newest series. You can see a demo of it in Welcome !\New Series\Ternary Series, if it helps.

Re: control the data which come from CSV file

Posted: Wed May 12, 2010 4:11 pm
by 13056035
First of all, thanks for your answer.

But I don't found the demo : Welcome !\New Series\Ternary Series

Image

I had the version 3.5.3188.18562 of teechart.

Is it in a new release ?

Re: control the data which come from CSV file

Posted: Wed May 12, 2010 4:17 pm
by yeray
Hi ljoli,

It was a new series in TeeChart for .NET v2009. You can see it in the eval:
http://www.steema.com/evaluation/net