GDI+: Rect. Gradient 2D Bars Start Below the Chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tsiipola
Newbie
Newbie
Posts: 21
Joined: Tue Oct 02, 2007 12:00 am

GDI+: Rect. Gradient 2D Bars Start Below the Chart

Post by tsiipola » Tue Nov 04, 2008 3:15 pm

The clipping of 2D bar chart that uses "Rect. Gradient" style does not work in GDI+ mode. The bars always start from 0 even if the chart axis starts from higher. In normal GDI mode the bars are clipped correctly.
How to reproduce:
1. Add a 2D bars series to the chart. Add some random values.
2. Set the style of series to "Rect. Gradient".
3. Set the Left Axis minimum to something over zero.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Nov 04, 2008 4:11 pm

Hi tsiipola,

Using this code:

Code: Select all

uses TeeGDIPlus, Series;

procedure TForm1.FormCreate(Sender: TObject);
var Series1, Series2: TBarSeries;
begin
  Chart1.Canvas := TGDIPlusCanvas.Create;

  Series1:=TBarSeries.Create(self);
  Series2:=TBarSeries.Create(self);

  Chart1.AddSeries(Series1);
  Chart1.AddSeries(Series2);

  Series1.FillSampleValues();
  Series2.FillSampleValues();

  Series1.BarStyle:=bsRectGradient;
  Series2.BarStyle:=bsRectGradient;

  Chart1.Draw;

  Chart1.Axes.Left.AutomaticMinimum:=false;
  Chart1.Axes.Left.Minimum:=10;
end;
I get this GDI+ chart:

Image

Commenting the GDI+ canvas creation line I get this:

Image

I see that bars slightly overlap bottom axes in both charts. Is that the issue you wanted to report? If not, could you please modify the code snippet above so that we can reproduce the issue here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tsiipola
Newbie
Newbie
Posts: 21
Joined: Tue Oct 02, 2007 12:00 am

Post by tsiipola » Wed Nov 05, 2008 7:04 am

Hello and thanks for the reply.
I noted that the bars in your screenshot are 3D. The issue is only reproduced with 2D bars.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 05, 2008 9:41 am

Hi tsiipola,

Sorry, I missed that. I could reproduce the issue now and added it (TV52013531) to the bug list to be fixed.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply