MAJOR XY Series Marks BUG!!

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Thu Jul 11, 2013 11:08 pm

I've just updated to XE4 and the latest version of TChart (2013.08.130521 32 bit). I have a couple of applications which use x-y charts with labels for each point. These have stopped working correctly. The point labels are not longer displayed. Instead the Y values are displayed. This "breaks" my application.

I've uploaded a test project which demonstates the problem. It should deplay all the letters of the alphabet from A to Z at random point. IT doesn't. Some Y-values are show instead.

Image

You can download the Delphi XE4 app here:

https://dl.dropboxusercontent.com/u/112 ... roblem.zip

I hope this can be fixed ASAP!!

Thanks,

Steve
Attachments
LabelProblem.zip
(82.14 KiB) Downloaded 616 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MAJOR XY Series Marks BUG!!

Post by Narcís » Fri Jul 12, 2013 3:15 pm

Hi Steve,

Thanks for reporting. We could reproduce the issue here in XE4. It works fine in other Delphi versions. Anyway, I have added it (TV52016639) to the defect list to be investigated and fixed for next releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Fri Jul 12, 2013 5:33 pm

This is a major issue for me. Can you send the source code changes once the corrections have been made?

Thanks,

Steve

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MAJOR XY Series Marks BUG!!

Post by Narcís » Mon Jul 15, 2013 7:10 am

Hi Steve,

Ok, I'll add a note on the bug description to send them when fixed.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Mon Jul 15, 2013 12:19 pm

Thanks Narcis,

Note that I cannot go back to an earlier version. This is the only version for XE4 and it's a breaking change. So can I kindly ask it's fixed ASAP.

Thanks,

Steve

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MAJOR XY Series Marks BUG!!

Post by Narcís » Mon Jul 15, 2013 12:45 pm

Hi Steve,

A workaround is using the OnGetMarkText creating the labels again:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer;
  var MarkText: string);
begin
  MarkText:=Chr(Ord('A') + ValueIndex);
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Mon Jul 15, 2013 1:06 pm

That works for the simple demo. However I need to access the Label text and this seems to get scrambled. If you add the following to the demo and associate it with Series1:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer; var MarkText: string);
begin
  MarkText := Series1.Labels[ValueIndex];
end;
It unfortunately still doesn't work :(

So it is a serious error!!

Thanks,

Steve

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

Re: MAJOR XY Series Marks BUG!!

Post by Yeray » Wed Jul 17, 2013 10:10 am

Hi Steve,
Steve Maughan wrote: However I need to access the Label text and this seems to get scrambled
Could you please tell us how are you exactly accessing the label text? Maybe we can suggest some workaround while the problem persists.
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

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Wed Jul 17, 2013 1:02 pm

Hi Yeray,

I've attached an updated demo of the error. I access the labels in the GetMarkText event and the error still persists.

Can this be sorted out soon? I can't believe I'm the only user with the problem as it's basic functionality which has been broken.

Thanks,

Steve
Attachments
LabelProblem2.zip
(82.22 KiB) Downloaded 645 times

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

Re: MAJOR XY Series Marks BUG!!

Post by Yeray » Thu Jul 18, 2013 9:12 am

Hi Steve,

Extending the workaround Narcís suggested above, you could store your labels in an array, and use it instead of Labels[ValueIndex]:

Code: Select all

var myLabels: array of String;

procedure TForm1.FormCreate(Sender: TObject);
var
  i: integer;
  x, y: double;
  s: string;
begin

  Chart1.BottomAxis.LabelStyle := talValue;
  Chart1.BottomAxis.LabelsFont.Style := [];
  Chart1.BottomAxis.AutomaticMinimum := false;
  Chart1.BottomAxis.Minimum := 0;

  Series1.Clear;
  Series1.Marks.Visible := true;
  Series1.Marks.Style := smsLabel;
  Series1.OnGetMarkText := Series1GetMarkText;

  SetLength(myLabels, 26);
  for i := 0 to 25 do
  begin
    x := Random(100);
    y := Random(100);
    s := Chr(Ord('A') + i);  // <-- Each Point has the Label A to Z
    Series1.AddXY(x, y, s);
    myLabels[i]:=s;
  end;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer; var MarkText: string);
begin
  MarkText := myLabels[ValueIndex];
end;
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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MAJOR XY Series Marks BUG!!

Post by Narcís » Thu Jul 18, 2013 9:48 am

Hi Steve,

We also have fixed the issue at TeEngine.pas. This only happens with XE4 due to series labels being Array of String instead of TList. The solution is implementing InternalInsert nested method in TLabelsList.InsertLabel method like this:

Code: Select all

  Procedure InternalInsert{$IFNDEF D18}(const P:PString){$ENDIF};
  {$IFDEF D18}
  var t : Integer;
  {$ENDIF}
  begin
    {$IFDEF D18}
    SetLength(List, Max(Count,ValueIndex)+1);

    while Count<ValueIndex-1 do
       List[Count-1]:='';

    for t:=Count-1 downto ValueIndex+1 do
        List[t]:=List[t-1];

    List[ValueIndex]:=ALabel;
    {$ELSE}

    while Count<ValueIndex do
          Add(nil);

    Insert(ValueIndex,P);
    {$ENDIF}
  end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Thu Jul 18, 2013 11:43 am

Great!

Can you send me the updated TeEngine.pas file?

Thanks,

Steve

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MAJOR XY Series Marks BUG!!

Post by Narcís » Thu Jul 18, 2013 11:48 am

Hi Steve,

Sure. I just sent it to your forums contact email address.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: MAJOR XY Series Marks BUG!!

Post by Steve Maughan » Thu Jul 18, 2013 12:10 pm

Hi Narcis,

Works!! Many thanks,

Steve

Post Reply