TMapSeries title position
TMapSeries title position
Hello,
I've just updated a project to the 2014.11.140512 and have an issue with a multiline title that used to position itself nicely in the middle of the rectangle shape.
I have tried turning off the new MapMarks->AutoSize and MapMarks->Centroid but no difference to its location.
Example image of the wrongly displayed title is added below. Is there anyway to get this to draw as it once did ?
[attachment=0]Snap-3.png[/attachment]
I've just updated a project to the 2014.11.140512 and have an issue with a multiline title that used to position itself nicely in the middle of the rectangle shape.
I have tried turning off the new MapMarks->AutoSize and MapMarks->Centroid but no difference to its location.
Example image of the wrongly displayed title is added below. Is there anyway to get this to draw as it once did ?
[attachment=0]Snap-3.png[/attachment]
- Attachments
-
- Snap-3.png (3.81 KiB) Viewed 22027 times
Re: TMapSeries title position
Hello,
I've tried to reproduce this with the code below:
But this is what I'm getting, that looks correct to me:
Could you please try to modify the code above so we can reproduce the problem here?
Alternatively, could you please arrange a simple example project with the same purpose?
Thanks in advance.
I've tried to reproduce this with the code below:
Code: Select all
uses Chart, TeeGDIPlus, TeeMapSeries, TeeConst;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
begin
Self.Caption:=TeeMsg_Version;
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
with Chart1.AddSeries(TMapSeries) as TMapSeries do
begin
FillSampleValues(2);
Labels.Labels[0]:='multiline'+sLineBreak+'label text';
Labels.Labels[1]:='another multiline'+sLineBreak+'label text';
Marks.Visible:=true;
end;
end;
Alternatively, could you please arrange a simple example project with the same purpose?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TMapSeries title position
Basic example as follows :-
TMapSeries* map = new TMapSeries(Chart1);
map->Marks->Visible = true;
Chart1->AddSeries(map);
Chart1->Legend->Visible = false;
TTeePolygon* shape = map->Shapes->Add();
shape->Text = "line 1\rline 2\rline 3";
shape->Closed = true;
shape->Points->AddXY(10, 10);
shape->Points->AddXY(10, 12);
shape->Points->AddXY(12, 12);
shape->Points->AddXY(12, 10);
Results in the following image which you can see the top of the text border is at the half way mark. With the older versions of TChart the text would be centred at Line 2 with Line 1 above the centre and Line 3 below the centre of the box.
TMapSeries* map = new TMapSeries(Chart1);
map->Marks->Visible = true;
Chart1->AddSeries(map);
Chart1->Legend->Visible = false;
TTeePolygon* shape = map->Shapes->Add();
shape->Text = "line 1\rline 2\rline 3";
shape->Closed = true;
shape->Points->AddXY(10, 10);
shape->Points->AddXY(10, 12);
shape->Points->AddXY(12, 12);
shape->Points->AddXY(12, 10);
Results in the following image which you can see the top of the text border is at the half way mark. With the older versions of TChart the text would be centred at Line 2 with Line 1 above the centre and Line 3 below the centre of the box.
- Attachments
-
- Snaps2.png (7.66 KiB) Viewed 21957 times
Re: TMapSeries title position
Hello,
I've been able to reproduce the problem in GDI.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=815
I've been able to reproduce the problem in GDI.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=815
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TMapSeries title position
Hello,
This issue has cropped up again for us.
I see the bug was lodged 2014-06-26 but still has NOT fixed ? Status just says CONFIRMED.
Is there a work around for this ? If you can let me know which source function maybe ?
Seems GDI & GDI+ have this issue under VCL.
This issue has cropped up again for us.
I see the bug was lodged 2014-06-26 but still has NOT fixed ? Status just says CONFIRMED.
Is there a work around for this ? If you can let me know which source function maybe ?
Seems GDI & GDI+ have this issue under VCL.
Re: TMapSeries title position
Ok I spent a bit of time test with TAnnotationTool as a work around.
Then I decided to look at the source and found TeeMapSeries.pas line 2408 :-
APosition.LeftTop.Y:=tmpY {-(APosition.Height div 2)};
So for some reason the vertical alignment has been commented out, any reason for this ?
I have tested for our use putting this calculation back and it works correctly.
Then I decided to look at the source and found TeeMapSeries.pas line 2408 :-
APosition.LeftTop.Y:=tmpY {-(APosition.Height div 2)};
So for some reason the vertical alignment has been commented out, any reason for this ?
I have tested for our use putting this calculation back and it works correctly.
Re: TMapSeries title position
Hello,
If the change you suggest works fine for you, don't hesitate to use it.
However, I'm afraid it doesn't seem to fix the sample code I posted in the ticket.
I've incremented the ticket priority.
http://bugs.teechart.net/show_bug.cgi?id=815
If the change you suggest works fine for you, don't hesitate to use it.
However, I'm afraid it doesn't seem to fix the sample code I posted in the ticket.
I've incremented the ticket priority.
http://bugs.teechart.net/show_bug.cgi?id=815
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TMapSeries title position
Hey Yeray,
Thanks
Yes was the code I tested with initially on 2015.15.150420 and our production release with last 2014.X
Its not perfect but pretty close to centered, image attached from 2015.X
Larger text is with the vertical adjustment in the DrawMark() function, the smaller test was just my quick test with TAnnotationTool
Thanks
Yes was the code I tested with initially on 2015.15.150420 and our production release with last 2014.X
Its not perfect but pretty close to centered, image attached from 2015.X
Larger text is with the vertical adjustment in the DrawMark() function, the smaller test was just my quick test with TAnnotationTool
- Attachments
-
- Cursor_and_Windows_7_x64_Dev.png (22.51 KiB) Viewed 21735 times
Re: TMapSeries title position
Just looking at this again in 2016.18 source version.
This does not seem to be fixed and my previous work around does not seem to be working.
Any insight into this ?
This does not seem to be fixed and my previous work around does not seem to be working.
Any insight into this ?
Re: TMapSeries title position
After a few hours of head scratching and frustration trying to figure out why my Delphi test app worked but not my Cpp.
I figured it must be compiling to the wrong BPL or something like that even though the environment vars were set correctly.
I uninstalled the binary packages I had installed prior to source install (to get the docs) and it is working again.
Might just take a break now while I'm ahead!
I figured it must be compiling to the wrong BPL or something like that even though the environment vars were set correctly.
I uninstalled the binary packages I had installed prior to source install (to get the docs) and it is working again.
Might just take a break now while I'm ahead!
Re: TMapSeries title position
Hello,
I've checked the #815 ticket and I may have found a fix for it.
Since I believe you own the sources, I would like you to confirm it before committing it to the production code.
At the TMapSeries.DrawMark method in TeeMapSeries.pas you'll find the snipped:
Change it for this:
I'm sorry for the headaches caused but I'm glad to hear you found how to get it to work!bdw wrote:I uninstalled the binary packages I had installed prior to source install (to get the docs) and it is working again.
I've checked the #815 ticket and I may have found a fix for it.
Since I believe you own the sources, I would like you to confirm it before committing it to the production code.
At the TMapSeries.DrawMark method in TeeMapSeries.pas you'll find the snipped:
Code: Select all
if MapMarks.AutoSize then
begin
tmpDiagonal:=tmpW/APosition.Width;
tmpSize:=4*Sqrt(tmpDiagonal);
Code: Select all
if MapMarks.AutoSize then
begin
tmpDiagonal:=tmpW/APosition.Width;
tmpSize:=Old*Sqrt(tmpDiagonal)/2;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TMapSeries title position
Hi Yeray,
Well part of the frustration was also 10.1 and compilation issues, just some weird behavior with compiler locking up. Even had one instance where the whole VM was trying to automatically resize, had to do a power off of the VM. So quite a combination.
I tried your code above but that only effects the font size and not the vertical alignment.
The only method to get the 3 lines to vertically center is to restore the line :-
APosition.LeftTop.Y:=tmpY-(APosition.Height div 2)
Well part of the frustration was also 10.1 and compilation issues, just some weird behavior with compiler locking up. Even had one instance where the whole VM was trying to automatically resize, had to do a power off of the VM. So quite a combination.
I tried your code above but that only effects the font size and not the vertical alignment.
The only method to get the 3 lines to vertically center is to restore the line :-
APosition.LeftTop.Y:=tmpY-(APosition.Height div 2)
Re: TMapSeries title position
Hello,
I see that line of code vertically centers the mark in the shape. I'll also add this line of code.bdw wrote:The only method to get the 3 lines to vertically center is to restore the line :-
APosition.LeftTop.Y:=tmpY-(APosition.Height div 2)
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |