Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 739 - Setting the chart's BevelOuter to bvNone in GDI makes the panel color to be drawn at the right and bottom
Summary: Setting the chart's BevelOuter to bvNone in GDI makes the panel color to be d...
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Canvas (show other bugs)
Version: unspecified
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-24 06:41 EDT by yeray alonso
Modified: 2014-11-07 13:36 EST (History)
3 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2014-04-24 06:41:03 EDT
Setting the chart's BevelOuter to bvNone in GDI makes the panel color to be drawn at the right and bottom.

uses TeCanvas;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;
  Chart1.Align:=alClient;
  Chart1.Canvas:=TTeeCanvas3D.Create;

  Chart1.BevelOuter:=bvNone;
  Self.Color:=clRed;
end;

This appeared with rev 1.40 of TeeProcs.pas.
It works fine again if I change, at TCustomTeePanelExtended.PanelPaint this:

with Canvas do
begin
  Brush.Color:=Self.PanelColor(tmpColor);

for this:

with Canvas do
begin
  Brush.Color:=Self.Color;

But this won't probably be the desirable fix. Maybe we should inflate the rectangle when BevelOuter=bvNone
Comment 1 John Ioannides 2014-11-05 03:16:15 EST
Hello,

Is it safe to use the fix proposed by Alonso?
Comment 2 david berneda 2014-11-07 13:36:42 EST
A different fix has been done, increasing the rectangle right and bottom coordinates to cover the missing pixels.

Still, there is one case where its not working, when:

  Chart1.BorderRound:=20;

Another case that works fine is:

  Chart1.Border.JoinStyle:=jsMitter;
  Chart1.Border.Show;
  Chart1.Border.Width:=3;

The fix is at TeeProcs.pas unit, at sub-procedure "PaintBack" inside the TCustomTeePanelExtended.FillPanelRect method:

  procedure PaintBack(ARect:TRect; AColor:TColor);
  begin
    // PrintTeePanel is a "trick" to paint Chart background also when printing.
    // When AColor = clNone, it means background should NOT be painted at all.

    with Canvas do
    begin
      if AColor=clNone then
         Brush.Style:=bsClear
      else
      begin
        Brush.Color:=AColor;
        Brush.Style:=bsSolid;
        Brush.Image:=nil;
      end;

      if Border.Visible then
         FixBorderWidth(ARect)
      else
      begin
        ARect.Right:=ARect.Right+1;
        ARect.Bottom:=ARect.Bottom+1;
      end;

      if BorderRound>0 then
         Canvas.RoundRect(ARect,BorderRound,BorderRound)
      else
         Canvas.Rectangle(ARect);
    end;
  end;