ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Pie Chart Layout - Overlap
Posted by Wats on May-10-2012 02:12
Attachments:
Hi Pete,

Is there an easy way to determine Legend Height, Pie Chart Height and Table Height in order to re-size and position chart without overlap. Please see attached image.

Thanks
Chart_Overlap.jpg

  Re: Pie Chart Layout - Overlap
Posted by Peter Kwan on May-10-2012 23:58
Hi Wats,

After entering all the data to the chart, you can call BaseChart.layoutLegend. After that, you can obtain the legend box height with Box.getHeight. For example (in Java/C#):

c.layoutLegend();
int myLegendHeight = c.getLegend().getHeight();

For the table, I assume it is a CDMLTable. You may obtain its height after calling CDMLTable.layout. For example:

myTable.layout();
int myTableHeight = myTable.getHeight();

For your chart, may be you can consider to just put the top 9 slices on the pie chart, and an additional slice called "Others" which represents everything that are not in the top 9 slices.

The purpose of the pie chart is to allow user to easily see the relative magnitude of the data values. If there are many small slices, it is hard to tell their relative size, and sometimes it is hard to see whether a slice exist at all. People often has to read the text labels instead. But for text reading, it is much better to read from a table. So the small slices on a pie chart are not really useful. In contrast, they may made the chart harder to read because of too many labels.

Unlikely text representation (such as a table), which can grow to as large as necessary, a pie chart usually has a finite size. So it cannot accomodate too much labels. Also, many people will have difficulty matching the slice color with the legend if there are too many slices.

If you need to plot many values in a chart so people can compare their magnitudes, a bar chart is another choice.

Regards
Peter Kwan