Page 1 of 1

TChart Height problem (VB6 - TeeChart v. 5)

Posted: Thu Oct 27, 2011 12:40 pm
by 6920463
Hi

I have a question regarding the height of the TeeChart control (v. 5).

I have a bug when trying to draw rectangles with texts on the TChart control (my program is written in VB6).
At the initialization, I calculate the needed height of the TChart.
Afterwards I draw the lines using the IAxes functions CalcXPosValue and CalcXPosValue (of the left and Bottom axes).

The problem is that in the initialization, when I calculate the needed height of the TChart for 1000 rectangles, I get the following:

TChart1.Height = [CurrentRowHeight] * (TChart1.Axis.left.Maximum + 1)

CurrentRowHeight is constant - I assign the size of the text to it, so it's value is 300 Twips = 20 Pixels.
TChart1.Axis.left.Maximum - it equals to the rows number (1000).

Re: TChart Height problem (VB6 - TeeChart v. 5)

Posted: Mon Oct 31, 2011 10:31 am
by yeray
Hello,

I'm not sure to understand the purpose of this. It looks like if you'd like to draw the axis grid manually, isn't it? Why don't you use the built-in axis grid?
Anyway, probably the rounding in CalcXPosValue and CalcYPosValue gives this +-1 pixel differences. To avoid it, you could calculate the position of the first line and draw the next lines simply adding 20 pixels on the Y, without any CalcYPosValue call.

Re: TChart Height problem (VB6 - TeeChart v. 5)

Posted: Tue Nov 01, 2011 8:17 am
by 6920463
Yes I agree but the real problem is in TChart1.Height property,
when I'm setting values over 245000 or something like that this property is limited to this number.
in my case I'm setting 1000(Lines) * 300(twips) = 300000 and after my set I'm still see that
the TChart1.Height is still at 245000 - it seems like limited for this number ,

any idea about this limitation ?

Thanks.

Re: TChart Height problem (VB6 - TeeChart v. 5)

Posted: Fri Nov 04, 2011 10:23 am
by yeray