GDI+ : a border around bars in Bar chart is always visible.

TeeChart for ActiveX, COM and ASP
Post Reply
ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

GDI+ : a border around bars in Bar chart is always visible.

Post by ESRI » Fri Feb 25, 2011 1:06 am

Border around bars in Bar chart is always visible in GDI+ mode. To repro:

1) create bar chart
2) start Tee Editor and turn off border visibility for bars. Borders disappear.
3) turn on GDI+ mode. Borders are back. I can change border style, color and I see changes while "Visibility" check-box is unchecked.

Actually, there are more borders appear around the graph in GDI+ mode. Bars in Bar chart is the simplest case.

Thanks,
Alex.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: GDI+ : a border around bars in Bar chart is always visible.

Post by Yeray » Fri Feb 25, 2011 9:46 am

Hi Alex,

In v8.07, in GDI+ you could hide the BarPen as follows:

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    FillSampleValues();
    BarPen.Visible:=false;
  end;

  Chart1.Canvas:=TGDIPlusCanvas.Create;
end;
However, in v2010, the following code doesn't hide the BarPen.
A workaround is to make the BarPen.Style to bsClear, but it's not exactly the same:

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    FillSampleValues();
    BarPen.Visible:=false;
    //BarPen.Style:=psClear;  //workaround not perfect
  end;

  with TTeeGDIPlus.Create(self) do
  begin
    TeePanel:=Chart1;
    Active:=true;
  end;
end;
So I've added it to the defect list to be revised for future releases (TV52015417).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply