How do I dynamically link an array of data using c++? The following doesn't work.
double *X;
X = new double[my_total_pts];
series1->YValues->Value = TChartValues(X); //this was in the hlp doc.
Everytime I update my data array, I want the graph update done. Every time I drag a point on the graph, I want the array updated. Any ideas?
Can someone point me to a good example? ? Thanks!
Dynamic Data Link using C++.
Hi,
i.e :
You can use the AddArray method. You can see some examples of use in the TeeChart Pro Demo Features project.How do I dynamically link an array of data using c++? The following doesn't work.
i.e :
Code: Select all
double vals1[6] = {3,6,8,15,19,21};
Series1->AddArray(vals1,5);
To update the Chart my best suggestion is that you run the AddArray() method after having made changes to the array. About the "drag point" you can update the Array using the OnDragPoint event of the DragPoint tool.Everytime I update my data array, I want the graph update done. Every time I drag a point on the graph, I want the array updated. Any ideas?
Pep Jorge
http://support.steema.com
http://support.steema.com
Ok, I'm fine with AddArray. Got that working great for loading the data.
Now, when I look at the Tea Tree Pro 7 demo that attempts to illustrate source code for coding OnDragPoint, it keeps asking me for a sample directory. Where is this supposed to be??? I don't seem to have it.
Thanks again. Almost there...
Now, when I look at the Tea Tree Pro 7 demo that attempts to illustrate source code for coding OnDragPoint, it keeps asking me for a sample directory. Where is this supposed to be??? I don't seem to have it.
Thanks again. Almost there...
Ok, I see where I can intercept the drag event using a user defined DragPointEvent.
Keep in mind I've only had this library for 2 days, so I'm still learning about it.
Now, I still don't see how I can grab the data from the TChartGrid and copy to my double array. How do I grab data from TChartGrid?? Ultimately,
I guess I should be read/writing ChartGrid as my source, but how do I access it??
Keep in mind I've only had this library for 2 days, so I'm still learning about it.
Now, I still don't see how I can grab the data from the TChartGrid and copy to my double array. How do I grab data from TChartGrid?? Ultimately,
I guess I should be read/writing ChartGrid as my source, but how do I access it??
Is this all TeeChart legal?
double *X,*Y;
X = new double[npts];
Y = new double[npts];
//read in X,Y data from bin file.
//clear series
series1->Clear();
//copy block data to Y series
series1->AddArray(Y,npts);
//same idea, but is this ok??? 8 bytes/pt
memcpy(&series1->YValues->Value[0],Y,npts*8);
//set npts; is this necessary if AddArray is used??
series1->XValues->Count = npts;
//set x values; is this ok????????
for (int i=0;i<npts;i++)
series1->XValues->Value = X;
//Last if setting data is not accepted using memcpy, is retrieving it ok??
memcpy(X,&series1->YValues->Value[0],npts*8);
...
Problem: If I clear the series "series1->Clear()", then AddArray for Y data, X coordinates are lost. How do I add back X data or will the methods I listed above work ok??
THANKS!
double *X,*Y;
X = new double[npts];
Y = new double[npts];
//read in X,Y data from bin file.
//clear series
series1->Clear();
//copy block data to Y series
series1->AddArray(Y,npts);
//same idea, but is this ok??? 8 bytes/pt
memcpy(&series1->YValues->Value[0],Y,npts*8);
//set npts; is this necessary if AddArray is used??
series1->XValues->Count = npts;
//set x values; is this ok????????
for (int i=0;i<npts;i++)
series1->XValues->Value = X;
//Last if setting data is not accepted using memcpy, is retrieving it ok??
memcpy(X,&series1->YValues->Value[0],npts*8);
...
Problem: If I clear the series "series1->Clear()", then AddArray for Y data, X coordinates are lost. How do I add back X data or will the methods I listed above work ok??
THANKS!