TAChart Bevel lazarus / 55-TAChart ---------------------------------------------------------------------- fpcoder · 2013-09-22 20:57 For the Chart I would like to set: BevelInner:= None BevelOuter:= None Is it possible somehow? ---------------------------------------------------------------------- wp · 2013-09-22 21:48 At first, I don't understand what you mean: Setting both the inner and the outer bevels to none results in "no bevel" - and that's the default. Anyway, let me explain here some possibilities to draw bevels with TAChart. Unlike Delphi's TeeChart there are no BevelInner and BevelOuter properties. But you're not lost... If you want a bevel around the outer chart border you could go the easy way and put the chart client-aligned into a Panel where you have access to these properties. Or you could use a separate TBevel component around the chart. Alternatively you could also modify the drawing procedure of the chart itself which would have the advantage that if you would save the chart to a file it would have the bevel also. And: you can also draw a bevel instead of the axis lines. There are two (or four) events you could consider: Before/AfterDrawBackground is called before/after the background of the entire control is painted. The BeforeDrawBackground event has a parameter which allows you to turn off the default drawing by setting ADoDefaultDrawing = false. You could even paint a background image or gradient this way. For a simple "lowered" bevel you could use the following procedure: Code: [Select]procedure TForm1.Chart1AfterDrawBackground(ASender: TChart; ACanvas: TCanvas;   const ARect: TRect); begin   with ACanvas do begin     Pen.Color := clBtnShadow;     MoveTo(ARect.Left, ARect.Bottom - 1);     LineTo(ARect.Left, ARect.Top);     LineTo(ARect.Right - 1, ARect.Top);     Pen.Color := clBtnHighlight;     LineTo(ARect.Right - 1, ARect.Bottom - 1);     LineTo(ARect.Left , ARect.Bottom - 1);   end; end;    There is another pair of procedures, Before/AfterDrawBackWall which gets called when painting the area enclosed by the axes. An example for an "etched" bevel (like for a panel with BevelOuter=bvLowered and BevelInner=bvRaised) is like this: Code: [Select]procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;   const ARect: TRect; var ADoDefaultDrawing: Boolean); var   R: TRect; begin   ADoDefaultDrawing := false;   with ACanvas do begin     Pen.Color := clBtnShadow;     MoveTo(ARect.Left, ARect.Bottom - 1);     LineTo(ARect.Left, ARect.Top);     LineTo(ARect.Right - 1, ARect.Top);     MoveTo(ARect.Right - 2, ARect.Top + 1);     LineTo(ARect.Right - 2, ARect.Bottom - 2);     LineTo(ARect.Left + 1, ARect.Bottom - 2);     Pen.Color := clBtnHighlight;     MoveTo(ARect.Left + 1, ARect.Bottom - 2);     LineTo(ARect.Left + 1, ARect.Top + 1);     LineTo(ARect.Right - 2, ARect.Top + 1);     MoveTo(ARect.Right - 1, ARect.Top);     LineTo(ARect.Right - 1, ARect.Bottom - 1);     LineTo(ARect.Left, ARect.Bottom - 1);   end; end; The code for these bevel drawing procedures is borrowed from the Paint method of TBevel (unit ExtCtrls). See the attached screenshot for the result. ---------------------------------------------------------------------- fpcoder · 2013-09-22 22:59 Interesting possibilities, might be handy in the future. At the moment there should be no bevel. I had simply put the Chart on a TPanel and forgotten about it. So it was this Panels bevel I tried to get rid of from TACharts properties.  Quote from: wp on September 22, 2013, 11:48:36 pmIf you want a bevel around the outer chart border you could go the easy way and put the chart client-aligned into a Panel where you have access to these properties. Or you could use a separate TBevel component around the chart.