Page 1 of 1

Editor->Series->Datasource->Function question

Posted: Wed Aug 03, 2005 10:40 am
by 9080443
Hi guys,

What I am trying to do is to apply functions to chart via Chart Editor. However in the listbox Source Series underneath Available there's no any available serie. How can I fix it? I am populating series in the code via respective value arrays.

Develop Platform: VC++ 6
Chart Component: Techart 6

Thank you for any help in advance.

Posted: Wed Aug 03, 2005 3:27 pm
by Pep
Hi,

I need more info, how you create the Series ? Which Series type are you using ? I'm going to need a simple example or the steps so I can reproduce it here and see which the problem is. If you want to send an example please post it on our newsgroups at : news://www.steema.net/steema.public.attachments

Posted: Thu Aug 04, 2005 8:59 am
by 9080443
Thank you for prompt reply. I am using bar, area and candle series so far.

Code: Select all

m_ctlTChart.AddSeries(scArea); 
m_ctlTChart.AddSeries(scBar); 
m_ctlTChart.AddSeries(scCandle);
here's how they are populated:

Bar serie

Code: Select all

//Setting Data arrays
	m_ctlTChart.Series(nSeriesIndex).AddArray(nElementsCount, YValues, XValues );  
CString sDate = "";
long nDate = 0;

if (bPrintLabels){

	for (long i=0; i<nElementsCount;i++ ) {
	
		sDate = m_arrDateLabels.GetAt(i); 		
		m_ctlTChart.Series(nSeriesIndex).SetPointLabel(i,sDate ); 
		
	}
}
Candle:

Code: Select all

for (long i=0;i<nElementsCount;i++){
		
		m_arrOpenValues.GetElement(&i,&nOpen); 
	
		m_arrHighValues.GetElement(&i,&nHigh); 
		 
		m_arrLowValues.GetElement(&i,&nLow); 
		 
		m_arrCloseValues.GetElement(&i,&nClose); 
		 
		m_arrDateValues.GetElement(&i,&nDate); 
		

	
		sDate = m_arrDateLabels.GetAt(i); 		
				
		m_ctlTChart.Series(nSeriesIndex).GetAsCandle().AddCandle(nDate ,nOpen,nHigh,nLow,nClose);    
	
	   m_ctlTChart.Series(nSeriesIndex).SetPointLabel(i,sDate); 
	}


Posted: Thu Aug 11, 2005 3:37 pm
by Pep
Hi,

I cannot reproduce the problem here, using the latest TeeChart Pro v7. I've posted a simple VC++ example into the news://www.steema.net/steema.public.attachments newsgroup, with the same "subject". Could you please test it, modify it, or tell me the steps I must do to reproduce the problem ?

Posted: Mon Sep 19, 2005 4:52 pm
by 9080443
Hi Pep,

Could you please send me this attachment to michael[a]softasap.net because I can't find it news. Thank you in advance.

Michael.

Posted: Tue Sep 20, 2005 7:36 am
by narcis
Hi Michael,

I've just sent it to you. However configuring the newsgroups is not much complicated. You should just set www.steema.net as the news server in your newsreader, without login information and using the default ports.

Posted: Tue Sep 20, 2005 12:42 pm
by 9080443
Hi Narcis,

Thank you, I received it. Actually I was subscribed to www.benrneda.com which was supposed to be your news? So now I believe it has changed to www.steema.com ?

Posted: Tue Sep 20, 2005 1:17 pm
by narcis
Hi,

It was www.berneda.com (which I think still works) and has changed to www.steema.net (not dot com :wink: ).

Posted: Tue Sep 20, 2005 8:27 pm
by 9080443
Hi Narcis,

You are right, of course I meant www.steema.net :). Ok, subscribed now to both news. Thanks.

Posted: Tue Oct 11, 2005 5:47 pm
by 9080443
hi Guys,

I think I have found out what a problem could be. The thing is that I am filling series via Add functions and not via <b> DataSource </b> property. I think that is the reason the series are not displayed in the "Available" listbox. So here is the question: can I somehow assign those values I filled up in arrays to be source of DataSource? Or another option I can convert that my source data in xml, can then I pass xml as DataSource? Please, advice. Thank you in advance.

P.S. I saw there are some classes like SeriesXMLSource but I am not sure how I could use them. Do you have any examples of using this and does it really help in my situation?

Thanks.

Posted: Thu Oct 13, 2005 7:29 am
by narcis
Hi,
So here is the question: can I somehow assign those values I filled up in arrays to be source of DataSource?
You can manually assign whatever you want to a recordset and then use it as datasource for your series. For more information on how to deal with TeeChart and datasources programmatically you could have a look at the TeeChart tutorials related to databases. You'll find them at TeeChart's program group.
Or another option I can convert that my source data in xml, can then I pass xml as DataSource? Please, advice. Thank you in advance.

P.S. I saw there are some classes like SeriesXMLSource but I am not sure how I could use them. Do you have any examples of using this and does it really help in my situation?


Yes, you can also use XML to populate your series. You'll find some examples at TeeChart's features demo, available at TeeChart's program group, searching for "XML".