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

Message ListMessage List     Post MessagePost Message

  Position of DataLabels
Posted by Björn on Feb-22-2021 22:34
Hi Peter,

I have a simple polar-chart. (see Attachment)

I've added a linelayer to the chart:

Call c.addAreaLayer(AnsMinVal, &HC9F47D35, "Anforderung")
set layer = c.addLineLayer(AnsVal, &HD85A0C, "Ergebnisse (eigene)")
call layer.setLineWidth(2)
call layer.setDataLabelStyle("arial.ttf", 9, &H888888)
call layer.setDataLabelFormat("{value|1}")

But the position of the labels disturbs. Is it possible to position the labels outside the linelayer? Like the red xxx in the example? So that the numbers do not cover the data points or the line?

Thanks for a short help.

  Re: Position of DataLabels
Posted by Peter Kwan on Feb-23-2021 02:15
Hi Björn,

By default, the labels will be put on top of the data point. For your case, may be you can try to use PolarLayer.addCustomDataLabel to configure different positions based on the "angle" of the data point. For 12 labels, may be you can try (in VB/VBScript):

alignment = Array(cd.Bottom, cd.BottomLeft, cd.Left, cd.Left, cd.Left, cd.TopLeft, cd.Top, cd.TopRight, cd.Right, cd.Right, cd.Right, cd.BottomRight)

For i = 0 To 11
    Call layer0.addCustomDataLabel(i, "{value|1}", "arial.ttf", 9, &H888888).setAlignment(alignment(i))

Hope this can help.

Peter Kwan