Page 1 of 1

Problem with CalcXPos and CalcXPosValue

Posted: Sat Oct 28, 2006 7:58 am
by 9524558
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

Posted: Tue Oct 31, 2006 11:04 am
by narcis
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

Posted: Tue Oct 31, 2006 11:47 am
by 9524558
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