Page 1 of 1

Bar3DSeries UseYOrigin False behavior

Posted: Wed May 18, 2005 8:20 pm
by 9333098
Bar3DSeries.UseYOrigin := false causes all bars to be drawn with their individual minimums set to the overall minimum of all bars. This causes all bars to be drawn down to the bottom axis. They no longer span just the range from their Y to Offset values. The Y axis minimum becomes the overall minimum of all bars.

Is this the designed behavior ? Could it instead keep displaying all bars over their Y to Offset range but only adjust the Y axis minimum to the overall minimum of all bars ? The Y axis acts this way. It autoscales to whatever the overall maximum of all bars is.

Posted: Thu May 19, 2005 7:33 am
by narcis
Hi Steve,

The problem is you are not setting YOrigin for the series and its default value is zero. You should do something like:

Code: Select all

  Series1.AddBar(1,4,2);
  Series1.YOrigin:=2;
  Series1.UseYOrigin:=true;

Posted: Thu May 19, 2005 1:05 pm
by 9333098
Narcis,

Setting YOrigin for the series basically means having to set the minimum value for the series. Typically, one does not have to set the series minimum. The chart does that automatically by itself. It just seemed to me that there could be consistant behavior if the Bar3D series could also determine the overall series minimum value, like it does with its overall maximum value.

Steve

Posted: Thu May 26, 2005 11:04 am
by Pep
Hi Steve,
Is this the designed behavior ? Could it instead keep displaying all bars over their Y to Offset range but only adjust the Y axis minimum to the overall minimum of all bars ? The Y axis acts this way. It autoscales to whatever the overall maximum of all bars is.
This is as designed, but you can always calculate the desired YOrigin and asign it in the OnAfterDraw event :

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Series1.YOrigin := Series1.MinYValue;
Series1.UseYOrigin := true;
end;