Page 1 of 1

Log problems with bar chart

Posted: Wed Mar 15, 2006 8:50 am
by 9336311
Hi

I have found an issue with log display using bars
we use numbers like 1 e -9, 1 e-10 etc

This display fine in a line or point chart but in a bar chart they are displayed incorrectly in log Y axis if the values are less than 1.

Peter

Posted: Wed Mar 15, 2006 10:08 am
by narcis
Hi Cyionics,

Can you please drop a TChart and a TButton in a form and test the code below? Does it reproduces the issue you report? I mean, the issue you are reporting is that the left axis is not properly scaled when using a TBarSeries?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.AddSeries(TBarSeries.Create(self));
  for i:=0 to 10 do Chart1[0].Add(random);

  Chart1.Axes.Left.Logarithmic:=true;
  Chart1[0].ValueFormat:='#.0 "x10" E+0';
end;

procedure TForm1.Button1Click(Sender: TObject);
var tmp: TChartSeries;
begin
  tmp:=Chart1[0];

  if tmp is TBarSeries then ChangeSeriesType(tmp, TLineSeries)
  else ChangeSeriesType(tmp, TBarSeries);
end;
Thanks in advance.

log display in bar

Posted: Wed Mar 15, 2006 11:24 am
by 9336311
Hi

Yes that certainly looks like the issue

Peter

Posted: Wed Mar 15, 2006 12:12 pm
by narcis
Hi Peter,

Thanks for confirming. I've added the issue (TV52011316) to our defect list to be fixed for future releases. In the meantime, you can try solving that problem by manually setting left axis minimum and maximum values using Chart1.Axes.Left.SetMinMax method.