Pie chart too small because of long labels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Pie chart too small because of long labels

Post by qcrnd » Tue Jun 01, 2010 8:23 am

Hey,
I have an issue with pie chart's where the chart width is small, the labels do not get cut (auto ellipsis) and the pie become very small if visible at all.
I have used the chart's GetSeriesMark event to add a line break, but this is done for every graph size.
Is there a way to get the rendered pie chart size, to add logic that will truncate the labels if the size is smaller that a certain threshold?.

Example of small chart because of long labels
Image

Another issue, see that in the attached image there is a lot of "wasted" vertical area this is done since the arrow size is fixed for all the marks, is there a way to define that the arrow size will be automatically calculated to get maximum pie size?

Thanks in advance
Elad

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

Re: Pie chart too small because of long labels

Post by Narcís » Tue Jun 01, 2010 2:07 pm

Hi Elad,
I have an issue with pie chart's where the chart width is small, the labels do not get cut (auto ellipsis) and the pie become very small if visible at all.
An option would be using CustomXRadius and CustomYRadius property as discussed here.
I have used the chart's GetSeriesMark event to add a line break, but this is done for every graph size.
Is there a way to get the rendered pie chart size, to add logic that will truncate the labels if the size is smaller that a certain threshold?.
Ok, in that case you can do something as what I did here. You may use that in the GetMarkText event.
Another issue, see that in the attached image there is a lot of "wasted" vertical area this is done since the arrow size is fixed for all the marks, is there a way to define that the arrow size will be automatically calculated to get maximum pie size?
I understand which is the problem here but I don't understand why it's related to arrow's size. I guess it's due to Circled property of pie series being set to true. Does setting it to false help? Otherwise, can you please elaborate on why do you think it's arrows size that causes this?

Thanks in advance.
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

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: Pie chart too small because of long labels

Post by qcrnd » Tue Jun 01, 2010 3:13 pm

Hey Narcís
An option would be using CustomXRadius and CustomYRadius property as discussed here.
Using the CustomXRadius & CustomYRadius will produce a constant size graph which isn't what I'm after.
Ok, in that case you can do something as what I did here. You may use that in the GetMarkText event.
This will not help me since I do not know when to reduce the text and when to leave it as is, since most of the times when the chart has enough room I will leave the labels as they are.
I understand which is the problem here but I don't understand why it's related to arrow's size. I guess it's due to Circled property of pie series being set to true. Does setting it to false help? Otherwise, can you please elaborate on why do you think it's arrows size that causes this?
The problem is not caused entirely by the arrow size, what I meant was to say that in some case I would like to reduce the arrow size to have more space for the chart.

What I'm getting at is having a way of ensuring a minimum pie size, either by a built in way or by events.
Like in regular chart when the area becomes too small, some of the legend items are omitted, and longs legend items text gets auto ellipsis (abcdefghijklmnop will become abc...nop)

Thanks in advance.
Elad

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

Re: Pie chart too small because of long labels

Post by Narcís » Wed Jun 02, 2010 2:18 pm

Hi Elad,
The problem is not caused entirely by the arrow size, what I meant was to say that in some case I would like to reduce the arrow size to have more space for the chart.
Arrow length can be set this way:

Code: Select all

      pie1.Marks.ArrowLength = 10;
What I'm getting at is having a way of ensuring a minimum pie size, either by a built in way or by events.
In that case you could check if XRadius and YRadius have a minimum value otherwise set them to a custom value. Otherwise set them back to automatic which is setting them to 0.

It may also help you using CustomChartRect feature as I explained here.
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

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: Pie chart too small because of long labels

Post by qcrnd » Wed Jun 02, 2010 7:42 pm

Thanks Narcis,
I got this working

Elad

Post Reply