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

Message ListMessage List     Post MessagePost Message

  Label lines for scatter/bubble
Posted by jerome provensal on Dec-16-2014 08:24
Attachments:
Hi Peter,
As you can see in the attached PNG, I have a few bubbles on top of one another and the
label (to left of the bubble) are also written on top of one another.
I was wondering if you have a method to have a line connected to the edge of each bubble
and at the other end of the line have the label; Very much like you have in your piecharts
like this one: http://www.advsofteng.com/images/iconpie2_m_p.png

Please advise.

Thanks.
bubbles.png

  Re: Label lines for scatter/bubble
Posted by Peter Kwan on Dec-17-2014 03:24
Hi Jerome,

Unluckily, ChartDirector does not have a built-in method to put the labels on the bubble
chart so that they are clear and do not overlap in all cases. It is because the unlike sectors
in a pie chart, the bubbles can overlap in arbitrary ways. Two bubbles can even 100%
overlap (this is, the two bubbles can be identical) or almost 100% overlap. A bubble can be
surrounded by other bubbles at all sides to make pointing to it difficult or hard to read
(especially if the bubble is small in size).

If in your case, you are sure you only have a few bubbles, you may consider to use
different colors for the bubbles and add a legend box to map the colors to labels.

If you can determine with your own code where to position the labels, you may use
Layer.addCustomDataLabel to add the label. This method will return a TextBox object, and
you can use TextBox.setPos to adjust the position of the labels. Another method is to use
BaseChart.addText to add labels at any place you want. If lines are needed, they can be
added using BaseChart.addLine.

Regards
Peter Kwan

  Re: Label lines for scatter/bubble
Posted by jerome provensal on Dec-17-2014 04:15
All good pointers!

Thanks Peter.