Page 1 of 1

Losing Top of Chart

Posted: Fri Mar 28, 2008 10:13 pm
by 10545668
In some cases the drawing of the chart loses some of the upper portion. You can see this behavior in the design time TChart component. Drop a TChart on the form and make sure you have the following set:

1. Ensure that the Titles are not visible.
2. Be sure the chart is a 2D chart.
3. Set the left or right axis such that the top tick mark is exactly at the top of the chart. In my case this was 500, and not 450.
4. Set the panel margins to 0.

The result is the upper half of the axis value is lost. The reason for this is the top of the chart is the upper edge of the drawing, but the axis fonts extend above the top of the chart because they are centered on the top of the chart.

A simple detour for this is to set the panel's top margin to 1%.

Posted: Mon Mar 31, 2008 9:30 am
by narcis
Hi MikeD,

I wouldn't say this is a bug, panel margins are for that. It may also help you setting axes MaximumOffset, for example:

Code: Select all

  Chart1.Axes.Left.MaximumOffset:=10;

Posted: Mon Mar 31, 2008 3:02 pm
by 10545668
I agree that it may not be a problem. However, if you set the panel background to a color, then the text runs off of the panel and into the margin.

While not a big deal, it doesn't look good.

Do with it what you wish.

Posted: Mon Mar 31, 2008 3:10 pm
by narcis
Hi MikeD,

I've added your request to our wish-list to be enhanced for future releases. Have you tried using MaximumOffset as I suggested?