Hi Jayant,
For your case, I assume you are using the method in the "Variable Width Bar Chart", in
which each bar is actually added as a separate area layer.
To achieve what you need, you may create an additional layer that contains the label
positions, and add the label to that layer. It is like:
Dim labelX As New List(Of Double)
Dim labelY As New List(Of Double)
For i As Integer = 0 To UBound(data)
' ending position of current bar
Dim nextX As Double = currentX + widths(i)
'Position of labels
labelX.Add((currentX + nextX) / 2)
labelY.Add(data(i))
.... create the bars using area layers as usual ....
Next
'An transparent layer containing the label position
Dim labelLayer As LineLayer = c.addLineLayer(labelY, Chart.Transparent)
labelLayer.setXData(labelX)
'Show the labels
labelLayer.setDataLabelStyle()
Hope this can help.
Regards
Peter Kwan |