Page 1 of 1

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

Posted: Tue Nov 04, 2008 3:15 pm
by 10546890
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.

Posted: Tue Nov 04, 2008 4:11 pm
by narcis
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.

Posted: Wed Nov 05, 2008 7:04 am
by 10546890
Hello and thanks for the reply.
I noted that the bars in your screenshot are 3D. The issue is only reproduced with 2D bars.

Posted: Wed Nov 05, 2008 9:41 am
by narcis
Hi tsiipola,

Sorry, I missed that. I could reproduce the issue now and added it (TV52013531) to the bug list to be fixed.