Page 1 of 1

Is it possible to get/calculate the plot area height?

Posted: Tue Sep 28, 2010 7:12 am
by 9530487
I need to calculate or get the height of the plot area. Is it possible? I've drawn what I need in the attachment.

I've got some Gantt plots, I want to be able to adjust the height of each bar automatically by dividing the plot area by the number of bars. But I cannot work out how to get at the size of the plot area. The Panel class gives the height of the whole TChart window which is not what I need.

Thanks in advance,

Tony.

Re: Is it possible to get/calculate the plot area height?

Posted: Wed Sep 29, 2010 9:54 am
by yeray
Hi Tony,

TChart1.GetChartRect gives you the Rectangle between the axes. The height will be Bottom-Top and the Width is Right-Left.

Re: Is it possible to get/calculate the plot area height?

Posted: Wed Sep 29, 2010 10:24 am
by 9530487
Thanks. I'm nearly there.

Another related question.

I calculate the bar height as

int nGanttBarHeight = nGraphHeight / ( 1 + nNumCustomLabels );

But when I set it for each gantt series (pTChart->GetSeries(i).GetAsGantt().GetPointer().SetVerticalSize(nGanttBarHeight) )
the pixel size is approximately double the calculated height. The help says "logical pixels", what is a logical pixel, and how do I convert my bar height to logical pixel size?

Thanks in advance,

Tony.

Re: Is it possible to get/calculate the plot area height?

Posted: Wed Sep 29, 2010 11:14 am
by 9530487
Not to worry, I found this post.

http://www.teechart.net/support/viewtop ... els#p40013

Once I divide the bar height by 2, it's ok.

I do think the function should be modified though to use the actual height, not height/2

Re: Is it possible to get/calculate the plot area height?

Posted: Wed Oct 06, 2010 10:35 am
by yeray
Hi Tony,

I've incremented the priority of the enhancement that Sandra mentioned in the thread you've just mentioned (TF02014155).