BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TeeChart LoadChartFromFile

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Fraser Ross
Guest





PostPosted: Tue Apr 27, 2004 1:05 pm    Post subject: TeeChart LoadChartFromFile Reply with quote



When I try to use the function I get the exception EClassNotFound and the
message "Class TBarSeries not found". This is the instruction I called it
with:
LoadChartFromFile(static_cast<TCustomChart*>(Chart1),
String("C:\Test.dat"));

I appear to have successfully used SaveChartToFile although I am not certain
what the last parameter is.

Fraser.



Back to top
Palle Meinert
Guest





PostPosted: Tue Apr 27, 2004 4:16 pm    Post subject: Re: TeeChart LoadChartFromFile Reply with quote



To make loading and saving of tee-charts work you must detach all events
before saving and attach them again after you have loaded the chart. In my
case this would require a lot of work and maintenance.



Instead I create a temporary TChart without events, too which I assign all
settings and save to file.



TChart* tChart = new TChart(this);

tChart->Assign(static_cast<TChart*>(SurfaceChart));


tChart->SeriesList->Assign(static_cast<TChartSeriesList*>(SurfaceChart->Seri
esList));

SaveChartToFile(tChart, ChangeFileExt(FileName, ".tee"), true, true);

tChart->SeriesList->Clear();

delete tChart;



Note that tChart is my temporary chart and SurfaceChart is the chart I want
to save. The last parameter in SaveChartToFile specify whether the data
should be stored binary or as text.



When loading the information, I do same in reverse order.



tChart = new TChart(this);

LoadChartFromFile(static_cast<Chart::TCustomChart*>(tChart) , FileName);

SurfaceChart->Assign(static_cast<TChart*>(tChart));

SurfaceChart->SeriesList->Assign(static_cast< TChartSeriesList
*>(tChart->SeriesList));

tChart->SeriesList->Clear();

delete tChart;



be aware that the above code is a extract, and I might have missed something
or introduced error’s while trying to simplify it.



If this does not help you, I suggest you try steema’s newsgroup



/Palle



"Fraser Ross" <fraserATmembers.v21.co.unitedkingdom> skrev i en meddelelse
news:408e5b44 (AT) newsgroups (DOT) borland.com...
Quote:
When I try to use the function I get the exception EClassNotFound and the
message "Class TBarSeries not found". This is the instruction I called it
with:
LoadChartFromFile(static_cast<TCustomChart*>(Chart1),
String("C:\Test.dat"));

I appear to have successfully used SaveChartToFile although I am not
certain
what the last parameter is.

Fraser.






Back to top
Fraser Ross
Guest





PostPosted: Tue Apr 27, 2004 5:48 pm    Post subject: Re: TeeChart LoadChartFromFile Reply with quote



Quote:

tChart->SeriesList->Assign(static_cast<TChartSeriesList*>(SurfaceChart->Seri
esList));

The line above won't compile because Assign is not a member of
TChartSeriesList.

I tried detaching the only event attached to the chart and it made no
difference.

All I need to save is the colours of the points. There is not a specific
function for that so I will probably implement a file format with
compression.

Fraser.



Back to top
Palle Meinert
Guest





PostPosted: Tue Apr 27, 2004 7:07 pm    Post subject: Re: TeeChart LoadChartFromFile Reply with quote

Quote:

tChart->SeriesList->Assign(static_cast<TChartSeriesList*>(SurfaceChart->Seri
esList));

The line above won't compile because Assign is not a member of
TChartSeriesList.

hmmm, it works for me with teechart 6 pro. And according to the on-line help

it enherits the assign method from TList.




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.