How do I change the name of the series programmatically for display in the legend? (Chart Object)
I have this as my needdatasource event and every time I try to hit series(0) I get index out of range errors. I have a datatable that always returns 3 columns of label, x, y and need to name x and y to what the user selects. (x = sales, y =volume). I have seen a number of examples, and tried them, but to no avail.
I have this as my needdatasource event and every time I try to hit series(0) I get index out of range errors. I have a datatable that always returns 3 columns of label, x, y and need to name x and y to what the user selects. (x = sales, y =volume). I have seen a number of examples, and tried them, but to no avail.
Private Sub Chart1_NeedDataSource(ByVal sender As Object, ByVal e As EventArgs) Handles Chart1.NeedDataSource |
Dim chart As Telerik.Reporting.Processing.Chart = TryCast(sender, Telerik.Reporting.Processing.Chart) |
Dim mydt As DataTable |
mydt = GetDTNoQ() |
Dim mycount As Int32 = CInt(mydt.Rows.Count / 8) |
Chart1.PlotArea.XAxis.LabelStep = mycount |
chart.DataSource = mydt |
'Dim mySeries As Telerik.Reporting.Charting.ChartSeries = Chart1.Series.GetSeries(0) |
'mySeries.Name = "Sales" |
End Sub |