Hi HANSOO,
You can use Layer.setDataLabelFormat, Layer.setDataLabelStyle or Layer.addCustomDataLabel to add labels to the vector arrows. The labels will be added to the stating point (the tail point) of the arrow. The text will be positioned either above or below the tail point depending on the arrow direction, so that the text does not overlap with the arrow.
An example (in C#) is like:
// Add label to the first arrow in the vector layer
myVectorLayer.addCustomDataLabel(0, 0, "My Label", "Arial Bold", 10, 0xcc0000, 0);
If you want to put labels in some other place, you may use a scatter layer and set the scatter symbol to transparent, so only the label remains. The following is an example:
https://www.advsofteng.com/doc/cdnet.htm#scatterlabels.htm
The following is an example to put a label center aligned to the point x = 50.0, y = 20.0.
// Add a scatter layer with 1 transparent symbol at (50, 20)
ScatterLayer labelLayer = c.addScatterLayer(new double[] { 50.0 }, new double[] { 20.0 }, "", Chart.SquareSymbol, 1, Chart.Transparent, Chart.Transparent);
// Add a label center aligned with the first symbol in the scatter layer
labelLayer.addCustomDataLabel(0, 0, "My Label", "Arial Bold", 10, 0xcc0000, 0).setAlignment(Chart.Center);
You can add more points to the scatter layer if you have more than one labels.
Hope this can help.
Regards
Peter Kwan |