Losing Top of Chart
Posted: Fri Mar 28, 2008 10:13 pm
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%.
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%.