Page 1 of 1

TBar3DSeries

Posted: Wed Dec 19, 2012 3:35 pm
by 10047857
Hi

I am plotting a TBar3D series to display temperature anomalies. Positive values get plotted above the zero line in red whilst negative values get plotted under the zero line in blue. The problem is that the zero line is sometimes aligned with the zero grid line, other times it floats +0.1 or +0.2 above the zero line. Can you suggest a fix or a workround? I have Use Origin ticked and the value set to zero.

Code: Select all

if Grid.Floats[6,r]>0 then
   Series.AddBar(Grid.Dates[0,r],Grid.Floats[6,r],0,'',clRed)
else
   Series.AddBar(Grid.Dates[0,r],0,Grid.Floats[6,r],'',clBlue);
Bruce.

Re: TBar3DSeries

Posted: Thu Dec 20, 2012 3:16 pm
by yeray
Hi Bruce,

I'm trying to reproduce the problem with v2012.07, but the grid line seems to be always correctly aligned with the 0 value.

Code: Select all

uses TeeConst, Bar3D;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Caption:=TeeMsg_Version;
  Chart1.View3D:=false;

  with Chart1.AddSeries(TBar3DSeries) as TBar3DSeries do
  begin
    for i:=0 to 5 do
      if (i mod 2 = 0) then
        AddBar(i, random*10, 0, '', clRed)
      else
        AddBar(i, -random*10, 0, '', clBlue);
  end;
end;
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Re: TBar3DSeries

Posted: Thu Dec 20, 2012 10:03 pm
by 10047857
Hi Yeray

I fixed the problem this afternoon. I had imported the project from my old development PC and so I just deleted and added the TChart component again and hooked it all up and it's now behaving itself! I think there was a slightly older version of TeeChart on the old machine.

Thanks for looking into it for me.

Bruce.

Re: TBar3DSeries

Posted: Fri Dec 21, 2012 9:03 am
by yeray
Hi Bruce,

I'm glad to see you could solve the problem :)