Hi soma,
I think the easiest method is to add a scatter layer in which the symbols are the position that you want the labels to appear. Then you can attach the labels to the scatter symbols.
For example, in the original "Variable Width Bar Chart" sample code, a bar is added using (in VB/VBScript);
dataX = Array(currentX, currentX, nextX, nextX)
dataY = Array(0, data(i), data(i), 0)
Set layer = c.addAreaLayer(dataY, colors(i), labels(i))
Call layer.setXData(dataX)
You can insert the following code "before" the above code (to ensure the symbol is on top of the bar):
Call c.addScatterLayer(Array((currentX + nextX) / 2), Array(data(i) / 2), "", cd.SquareSymbol, 1, cd.Transparent, cd.Transparent).addCustomDataLabel(0, 0, labels(i) & vbLF & data(i), "arialbd.ttf", 8, &H000000).setAlignment(cd.Center)
Hope this can help.
Regards
Peter Kwan |