TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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.
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 644 times
-
Narcís
- Site Admin

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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.
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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.
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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;
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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

- Posts: 9645
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
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.
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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 673 times
-
Yeray
- Site Admin

- Posts: 9645
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
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;
-
Narcís
- Site Admin

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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;
-
Steve Maughan
- Newbie

- Posts: 48
- Joined: Tue Aug 03, 2010 12:00 am
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

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu Jul 18, 2013 11:48 am
Hi Steve,
Sure. I just sent it to your forums contact email address.