painting background below y=0
Posted: Tue Jun 15, 2004 1:01 pm
How does one go about painting the chart background red below the y=0 line?
Steema Software - Customer Support Forums
http://teechart.com/support/
Code: Select all
Uses Math;
procedure TForm1.Chart1BeforeDrawAxes(Sender: TObject);
var R: TRect;
begin
R.Left := Chart1.ChartRect.Left;
R.Right := Chart1.ChartRect.Right;
// trick to avoid costly clipping routine
R.Top := Max(Chart1.Axes.Left.CalcYPosValue(0.0),Chart1.ChartRect.Top);
R.Bottom := Chart1.ChartRect.Bottom;
if R.Top < R.Bottom then
With Chart1.Canvas do
begin
Brush.Color := clRed;
Rectangle(R,0); // draw at z=0
end;
end;