Pie mark label location not centered to segment

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Pie mark label location not centered to segment

Post by bdw » Wed Jul 10, 2013 3:57 am

Hello,
I'm trying to use a number of pie or TDonutSeries styles but I'm having problems with the Marks label. I would like to use the label rotation as well depending on the pie rotation angle.

Its seems the the mark label for a segment draws with the right hand side of the label in the centre of the segment. I would like to move the label so that it is centered in the segment.

I've attached an example of a pie chart drawing the label not centered in a segment. In this example the Total angle = 90, circle = true, Rotation = 45

Any ideas ?
Attachments
pie-label.png
pie-label.png (12.76 KiB) Viewed 5900 times

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

Re: Pie mark label location not centered to segment

Post by Yeray » Wed Jul 10, 2013 3:29 pm

Hi,

You could modify the marks positions manually calculating the desired positions in a similar way than in the following threads:
http://www.teechart.net/support/viewtop ... 589#p61589
http://www.teechart.net/support/viewtop ... 643#p45643

In your case, you'll have to use some properties like XRadius, YRadius, Angles.MidAngle and AngleToPos function to calculate the desired position
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

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: Pie mark label location not centered to segment

Post by bdw » Thu Jul 11, 2013 1:54 am

Thanks.

That got me on the right track, TSeriesMarkPosition* tsp->Custom = true, was a key for me

Post Reply