Page 1 of 1

Lowest axis label disappears

Posted: Mon Jul 26, 2010 9:09 pm
by 9244525
Hello,

I have two custom axis as seen on the enclosed screen shot.
If the axis scale is set from -1 to 11 (as the first custom axis), everything is displayed OK.
If the axis scale is set from -2 to 11 (as the second custom axis), the lowest label disappears!

Here is the relevant code:

for i := 1 to 2 do
begin
Chart1.Axes.Items[i+5].SetMinMax(frmGraphSettings.ViewScaleFrom, frmGraphSettings.ViewScaleTo);
Chart1.Axes.Items[i+5].Increment := (frmGraphSettings.ViewScaleTo - frmGraphSettings.ViewScaleFrom)/10;
Chart1.Axes.Items[i+5].RoundFirstLabel := False;
end;

Do I do anything wrong, that causes the lowest label to disappear??

Re: Lowest axis label disappears

Posted: Tue Jul 27, 2010 3:36 pm
by yeray
Hi ChartIt,

I've tried to reproduce it with the following code but couldn't:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var n, i: Integer;
begin
  Chart1.Align:=alClient;

  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;
  Chart1.MarginRight:=10;

  for n:=0 to 1 do
  begin
    Chart1.AddSeries(TFastLineSeries);

    Chart1[n].Add(Random*10);
    for i:=1 to 49 do
      Chart1[n].Add(Chart1[n].YValue[i-1]+Random-0.4);

    Chart1.CustomAxes.Add;
    Chart1[n].CustomVertAxis:=Chart1.CustomAxes[n];
    Chart1.CustomAxes[n].OtherSide:=true;
    Chart1.CustomAxes[n].RoundFirstLabel:=false;
    Chart1.CustomAxes[n].Axis.Visible:=false;
  end;

  Chart1.CustomAxes[0].Increment:=1.2;
  Chart1.CustomAxes[1].Increment:=1.3;

  Chart1.CustomAxes[0].SetMinMax(-1,11);
  Chart1.CustomAxes[1].SetMinMax(-2,11);

  Chart1.CustomAxes[1].LabelsFont.Color:=clRed;
  Chart1.CustomAxes[1].PositionUnits:=muPixels;
  Chart1.CustomAxes[1].PositionPercent:=Chart1.CustomAxes[1].PositionPercent-30;
end;
labels.png
labels.png (7.16 KiB) Viewed 7163 times
Could you please tell us wha exact TeeChart version and IDE are you using?

Re: Lowest axis label disappears

Posted: Tue Jul 27, 2010 8:47 pm
by 9244525
Sorry for the missing information.
I use TChart Pro v7.08 with Delphi 2006 on Windows XP Professional SP3.

Re: Lowest axis label disappears

Posted: Tue Jul 27, 2010 8:58 pm
by 9244525
Hi,
I get the same bad result when trying your code.

Re: Lowest axis label disappears

Posted: Thu Jul 29, 2010 8:54 am
by yeray
Hi ChartIt,

I've reproduced the issue in a system like yours and I can confirm that the latest TeeChart VCL v2010 works as in the picture I showed you before.
You can try it if you want: http://www.steema.com/evaluation/vcl

In v7 I've also seen that playing with the MinimumOffset you could work around this:

Code: Select all

Chart1.CustomAxes[1].MinimumOffset:=1;

Re: Lowest axis label disappears

Posted: Sun Sep 12, 2010 8:27 am
by 9244525
Hi again :)

I upgraded to v2010 and the label disappearing problem seemed to be solved.
I then upgraded further to the "non-stable" upgrade to solve a couple of other issues.
It now seems like the label disappearing problem has been reintroduced (see screen shot).

What's going on??

Re: Lowest axis label disappears

Posted: Tue Sep 14, 2010 11:08 am
by yeray
Hi ChartIt,

First, I've ran the project I proposed above and noticed nothing irregular.
Then I saw in your picture that you've changed the axes minimum and maximum, and , after trying the same than you, I could reproduce the problem.

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var n: Integer;
begin
  Chart1.Align:=alClient;

  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;
  Chart1.MarginLeft:=20;

  for n:=0 to 4 do
  begin
    Chart1.AddSeries(TFastLineSeries);

    Chart1[n].FillSampleValues();

    Chart1.CustomAxes.Add;
    Chart1[n].CustomVertAxis:=Chart1.CustomAxes[n];
    with Chart1.CustomAxes[n] do
    begin
      Axis.Visible:=false;
      Ticks.Visible:=false;
      PositionUnits:=muPixels;
      PositionPercent:=-n*30;
      LabelsFont.Color:=Chart1[n].Color;

      if ((n = 0) or (n = 1) or (n = 2)) then
        SetMinMax(-24, 216)
      else if (n = 3) then
        SetMinMax(-0.2, 1.8)
      else if (n = 4) then
        SetMinMax(-0.3, 2.7);

      Increment:=(Maximum - Minimum) / 10;
      //MinimumOffset:=1;  //workaround
    end;
  end;
end;
So it seems to be reproducible in very particular cases, and still the MinimumOffset property seems to solve the problem.
Anyway, I've added it to the defect list to be revised fur future releases (TV52015150).