Lowest axis label disappears

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ChartIt
Newbie
Newbie
Posts: 29
Joined: Tue Mar 13, 2007 12:00 am

Lowest axis label disappears

Post by ChartIt » Mon Jul 26, 2010 9:09 pm

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??
Attachments
Chart axis.JPG
Chart axis.JPG (42.48 KiB) Viewed 7139 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Lowest axis label disappears

Post by Yeray » Tue Jul 27, 2010 3:36 pm

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 7092 times
Could you please tell us wha exact TeeChart version and IDE are you using?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ChartIt
Newbie
Newbie
Posts: 29
Joined: Tue Mar 13, 2007 12:00 am

Re: Lowest axis label disappears

Post by ChartIt » Tue Jul 27, 2010 8:47 pm

Sorry for the missing information.
I use TChart Pro v7.08 with Delphi 2006 on Windows XP Professional SP3.

ChartIt
Newbie
Newbie
Posts: 29
Joined: Tue Mar 13, 2007 12:00 am

Re: Lowest axis label disappears

Post by ChartIt » Tue Jul 27, 2010 8:58 pm

Hi,
I get the same bad result when trying your code.
Attachments
Chart axis.JPG
Chart axis.JPG (141.84 KiB) Viewed 7067 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Lowest axis label disappears

Post by Yeray » Thu Jul 29, 2010 8:54 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ChartIt
Newbie
Newbie
Posts: 29
Joined: Tue Mar 13, 2007 12:00 am

Re: Lowest axis label disappears

Post by ChartIt » Sun Sep 12, 2010 8:27 am

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??
Attachments
Lower label.JPG
Lower label.JPG (69.77 KiB) Viewed 6995 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Lowest axis label disappears

Post by Yeray » Tue Sep 14, 2010 11:08 am

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).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply