This is a migrated thread and some comments may be shown as answers.

Legend Series Name

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 24 Jul 2009, 05:07 PM
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.

    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 

1 Answer, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 2
answered on 27 Jul 2009, 06:45 PM
Please ignore this thread as 2 other threads are handling this topic currently.
Tags
General Discussions
Asked by
Joel
Top achievements
Rank 2
Answers by
Joel
Top achievements
Rank 2
Share this question
or