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

Message ListMessage List     Post MessagePost Message

  Inquiry About Overlapping Data Labels in Scatter Chart
Posted by Ji-hyeon Choi on Mar-13-2026 12:49
Attachments:
Hello,

We are currently using ChartDirector to implement charts, specifically the Scatter Chart functionality.

When displaying data labels for each data point, we have encountered an issue where data labels overlap when multiple data points have the same or very similar coordinates. In such cases, the labels are rendered on top of each other, making it difficult to identify which label belongs to which data point.

For example, when multiple data points exist at the same or very close positions (e.g., labels such as A1, A3, D3), the data labels overlap in the chart and become hard to distinguish.

We would like to ask if ChartDirector provides any of the following capabilities:

A feature that automatically adjusts the position of data labels to avoid overlapping in a Scatter Chart.

If the label position is moved, whether it is possible to draw a leader line connecting the data label to the corresponding data point.

If these features are not available by default, whether there is a recommended approach or example for implementing this behavior using ChartDirector APIs.

We will attach example images illustrating the overlapping label issue for reference.

Thank you for your assistance.
Best regards.
chartexample.PNG

  Re: Inquiry About Overlapping Data Labels in Scatter Chart
Posted by Peter Kwan on Mar-13-2026 18:04
Hi Ji-hyeon Choi,

Unluckily, ChartDirector does not have a built-in feature to automatically move the labels or add a line to connect the label to the scatter symbol. You can try to use your own code to move the labels.

For example, if your code can detect that two data points overlaps, you can move one label up and the other down using CDML syntax. Assuming the labels are "C1" and "A2", you can change them to "<*font,yOffset=8*>C1" and "<*font,yOffset=-8*>A2". You can use half the font size as the yOffset.

Another method is to use "C1<*br*>A2" for one label, and to cancel the other label. The "C1<*br*>A2" means to display C1 and A2 in two lines. (The <*br*> is the line break.)

For more information on the CDML syntax, see:

https://www.advsofteng.com/doc/cdcpp.htm#cdml.htm

You can also use Layer.addCustomDataLabel.htm to control the alignment of the labels. For example, you can put one label at the left side of the data point, and the other label at the right side of the data point. You can also choose other locations like Top/Bottom, TopLeft/BottomLeft, etc.

layer->addCustomDataLabel(1, 2, "C1", "Arial", 8, 0x000000)->setAlignment(Chart::Left);

layer->addCustomDataLabel(1, 2, "A2", "Arial", 8, 0x000000)->setAlignment(Chart::Right);

See:

https://www.advsofteng.com/doc/cdcpp.htm#Layer.addCustomDataLabel.htm

Best Regards
Peter Kwan