Legend Series Name

2 posts, 0 answers
  1. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 24 Jul 2009 Link to this post

    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 

  2. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 27 Jul 2009 Link to this post

    Please ignore this thread as 2 other threads are handling this topic currently.
  3. DevCraft banner
Back to Top