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

Message ListMessage List     Post MessagePost Message

  Labels on the pie chart
Posted by Dmitriy on May-31-2012 16:15
Attachments:
Hello.

I have the pie chart with 1 to 3 sectors and labels on it. The labels are always inside the pie because I have no enough room to place them outside the pie chart using setLabelLayout(Chart::SideLayout) feature.

As you can see on the screenshot below, I?ve got a situation when 2 sectors are too small to display their labels correctly, which in turns leads to labels overlapping.

Is there any way to make them all visible taking into account the above limitations?

Dmitriy.
labels.png

  Re: Labels on the pie chart
Posted by Peter Kwan on Jun-01-2012 04:27
Hi Dmitriy,

There are no general methods to avoid labels overlapping. If the pie is small enough, and the text is large enough, the text always overlap.

However, if you can limit to 3 sectors, I have thought of a method that may work for your specific case.

(a) Instead of using a two line label, may be you can reduce it to one line.

(b) If your code detects that there are two smaller sectors, you may try to put one label near the perimeter of the pie, and another label closer to the center of the pie. (You can use Sector.setLabelPos to configure a different label position for each sector.) As your label is only one line high, and the smaller sectors should always be near the top of the pie (or nearly "vertical"), so the two labels should not overlap.

To help the user to clearly see which label is for which sector, you may consider to choose different label backgrouind colors for the sectors to better match the label background colors to the sector colors. (You can use Sector.setLabelStyle to set a different label style for each sector.)

Regards
Peter Kwan

  Re: Labels on the pie chart
Posted by Dmitriy on Jun-01-2012 18:00
Hello Peter,

Thanks for the suggested solutions. I have followed your second advice and now everything looks good.

Dmitriy.