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

TeeChart for ActiveX, COM and ASP
Post Reply
TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

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

Post by TonyVSUK » Tue Sep 28, 2010 7:12 am

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.
Attachments
TChart Plot area height.jpg
TChart Plot area height.jpg (84.74 KiB) Viewed 8191 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Sep 29, 2010 9:54 am

Hi Tony,

TChart1.GetChartRect gives you the Rectangle between the axes. The height will be Bottom-Top and the Width is Right-Left.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

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

Post by TonyVSUK » Wed Sep 29, 2010 10:24 am

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.

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

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

Post by TonyVSUK » Wed Sep 29, 2010 11:14 am

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

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Oct 06, 2010 10:35 am

Hi Tony,

I've incremented the priority of the enhancement that Sandra mentioned in the thread you've just mentioned (TF02014155).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply