I am trying to add an array of X and an array of Y values to a TLineSeries (TFastLineSeries) using BCB 6.0. I cannot see how to do this from the examples. Any assistance would greatly be appreciated.
Thanks
M Weingarden
Adding arrays to TLineSeries BCB 6.0
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MTW,
You can find an example at All Features\Welcome!\Speed\Fast Dynamic Arrays at the new features demo, available at TeeChart's program group.
You can find an example at All Features\Welcome!\Speed\Fast Dynamic Arrays at the new features demo, available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Thank you.
However, when I run Tee8New.exe, I get an error "Class TSurfaceSides Not Found" and when I go to All Features\Welcome\Speed\Fast Dynamic Arrays, I do not get the example showing.
Perhaps you could identify the module that uses arrays for both X and Y variables. I am able to use AddArray for Y variables, but I do not see how to do it for the X data elements as well.
However, when I run Tee8New.exe, I get an error "Class TSurfaceSides Not Found" and when I go to All Features\Welcome\Speed\Fast Dynamic Arrays, I do not get the example showing.
Perhaps you could identify the module that uses arrays for both X and Y variables. I am able to use AddArray for Y variables, but I do not see how to do it for the X data elements as well.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MTW,
AddArray only supports adding Y values array. For adding X and Y values you need to do as in the menitoned example, which is very similar to the Real-time Charting article here.
Which TeeChart version are you using? I'll send you the URL to download v8.03 which is a test version. We will soon release v8.04.
AddArray only supports adding Y values array. For adding X and Y values you need to do as in the menitoned example, which is very similar to the Real-time Charting article here.
Which TeeChart version are you using? I'll send you the URL to download v8.03 which is a test version. We will soon release v8.04.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I am using V 8.0.
I have seen the article and am trying to figure out how to get it done in C - BCB v6.0.
If there is a BCB example, as demonstrated in the article, in one of the modules in the example folders, I will gladly look at it. If not, is it possible to include a few lines of code showing how to add the X and Y arrays in C.
Thank you
I have seen the article and am trying to figure out how to get it done in C - BCB v6.0.
If there is a BCB example, as demonstrated in the article, in one of the modules in the example folders, I will gladly look at it. If not, is it possible to include a few lines of code showing how to add the X and Y arrays in C.
Thank you
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello,
This is how can you add X and Y values arrays to series using BCB 6:
Hope this helps!
This is how can you add X and Y values arrays to series using BCB 6:
Code: Select all
// TChartValues
DynamicArray<double> X;
DynamicArray<double> Y;
// number of points }
int Num = StrToInt(Edit1->Text);
// allocate our custom arrays }
X.Length = Num;
Y.Length = Num;
// fill data in our custom arrays }
X[0] = 0;
Y[0] = random(10000);
for (int t=1; t<Num;t++)
{
X[t] = t;
Y[t] = Y[t-1]+random(101)-50;
}
// set our X array }
Series1->XValues->Value =(TChartValues)(X); // <-- the array
Series1->XValues->Count = Num; // <-- number of points
Series1->XValues->Modified = true; // <-- recalculate min and max
// set our Y array }
Series1->YValues->Value = (TChartValues)(Y); // <-- the array
Series1->YValues->Count = Num; // <-- number of points
Series1->YValues->Modified = true; // <-- recalculate min and max
Chart1->UndoZoom(); // <-- remove zoom (optional)
// Show data
Series1->Repaint();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Adding arrays to TLineSeries BCB 6.0
I am now using TeeChart VCL 8.06 in both BCB 6.0 and CodeGear 2010.
Your description of using an array for adding both X and Y values allows me to code it and use the functions as described. However, I am now using it for real time graphics, where I want to add a set of data to a chart (that has existing data). I would like to retain the existing data, unless I am over my display number of points, when then I use the Delete function. What I am seeing is that when I add the X,Y values as shown, it is replacing the existing data set with the new set and all previous data is lost.
Is there a way to add the X Y array (C++ code) to existing data in the graph? In the realtime article, it shows that data can be added to Value.Last. Is there any way to do this with an array?
Thank you
M Weingarden
Your description of using an array for adding both X and Y values allows me to code it and use the functions as described. However, I am now using it for real time graphics, where I want to add a set of data to a chart (that has existing data). I would like to retain the existing data, unless I am over my display number of points, when then I use the Delete function. What I am seeing is that when I add the X,Y values as shown, it is replacing the existing data set with the new set and all previous data is lost.
Is there a way to add the X Y array (C++ code) to existing data in the graph? In the realtime article, it shows that data can be added to Value.Last. Is there any way to do this with an array?
Thank you
M Weingarden
Re: Adding arrays to TLineSeries BCB 6.0
Hi
The AddArray function is a feature request already in the with list (TV52014513), as you can see here.
I've incremented it's priority.
The AddArray function is a feature request already in the with list (TV52014513), as you can see here.
I've incremented it's priority.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |