Problem with CalcXPos and CalcXPosValue

TeeChart for ActiveX, COM and ASP
Post Reply
Andras
Newbie
Newbie
Posts: 40
Joined: Thu Oct 14, 2004 4:00 am
Location: Hungary

Problem with CalcXPos and CalcXPosValue

Post by Andras » Sat Oct 28, 2006 7:58 am

Dear Support

I'm adding a few points to a point series, and then I would like to determine the screen horizontal pixel equivalent of a point or a value, so I write:

PIXEL=frmXX.TChartContour.Series(1).CalcXPosValue(XVALUE)

or

PIXEL =frmXX.TChartContour.Series(1).CalcXPos(IPOINT)

but I always get 0. Why? What can be the problem, what do I do wrong?

Tx in advance, best regards

Andras

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Oct 31, 2006 11:04 am

Hi Andras,

It is most likely that the chart hasn't been drawn at the moment you make that call. You can try adding the line below to force the chart being drawn and therefore having valid values for using those methods.

Code: Select all

    TChart1.Environment.InternalRepaint
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Andras
Newbie
Newbie
Posts: 40
Joined: Thu Oct 14, 2004 4:00 am
Location: Hungary

Post by Andras » Tue Oct 31, 2006 11:47 am

Dear Narcis

Tx for help first of all. Although I do not clearly understand your reasoning, because I definitely know, that the chart has been drawn at the moment of the prcedure call, but anyway it works now fine. So thank you very much for this little trick. :D

best regards

Andras

Post Reply