Datalabels are displayed 0% every time,value are there in column L,but always displays 0 only.What may be the reason.Can you please check the code once.
I have written below code.
chart.Title.Text = "TM Product Usage"
chart.Title.TextFont.Name = "Arial"
chart.Title.TextFont.Size = 12
chart.Title.TextFont.IsBold = True
chart.Title.TextFont.Color = Color.Black
'Set series
chart.NSeries.Add("By Acct Type!B2:B" & intMaxRows, True)
chart.NSeries.Add("By Acct Type!L2:L" & intMaxRows, True)
chart.NSeries(0).Name = "Number of Relationships"
chart.NSeries.CategoryData = "By Acct Type!A2:A" & intMaxRows
chart.NSeries(1).PlotOnSecondAxis = True
chart.ValueAxis.Title.Rotation = 90
chart.ValueAxis.Title.TextFont.Size = 12
chart.ValueAxis.Title.TextFont.Name = "Arial"
chart.ValueAxis.Title.TextFont.IsBold = True
chart.ValueAxis.Title.Text = "Number of Relationships"
chart.ValueAxis.Title.TextFont.Color = Color.Black
chart.ValueAxis.IsVisible = True
chart.NSeries(1).DataLabels.IsValueShown = True
chart.NSeries(1).DataLabels.Postion = LabelPositionType.InsideBase
chart.NSeries(1).Line.IsVisible = False
chart.NSeries(1).Area.Formatting = FormattingType.None
chart.NSeries(1).MarkerStyle = ChartMarkerType.None
chart.IsLegendShown = False
chart.MajorGridLines.IsVisible = False
chart.ChartArea.Border.IsVisible = False
Dim pointsCount As Integer
pointsCount = chart.NSeries(0).Points.Count
Dim i As Integer
For i = 0 To pointsCount
If (i >= 0 And i <= 10) Then
excel.ChangePalette(Color.SeaGreen, 40)
chart.NSeries(0).Points(i).Area.ForegroundColor = Color.SeaGreen
ElseIf (i >= 11 And i <= 19) Then
excel.ChangePalette(Color.DarkRed, 41)
chart.NSeries(0).Points(i).Area.ForegroundColor = Color.DarkRed
Else
excel.ChangePalette(Color.Orange, 42)
chart.NSeries(0).Points(i).Area.ForegroundColor = Color.Orange
End If
Next
Thanks,
Arun