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

CreateSeries not working Properly

1 Answer 35 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
henzard
Top achievements
Rank 1
henzard asked on 28 Jun 2012, 11:19 AM
The Xaxis does not show the correct labels and all the september's are not grouped together 

What am i doing wrong

Dim oldsubcategory_id As String = "ZZ"
        Dim subcategory_id As String
        Dim currentSeries As ChartSeries = Nothing
        BarChartForAcc.Series.Clear()
        If (ShowList().Count > 0) Then
            For Each DataRow In GuiDataSource().Rows
                subcategory_id = DataRow("ACCOUNTNUM")
                If subcategory_id <> oldsubcategory_id Then
                    currentSeries = BarChartForAcc.CreateSeries(DataRow("ACCOUNTNUM"), Color.Empty, Color.Empty, ChartSeriesType.Bar)
                    currentSeries.Appearance.Border.Color = Color.Black


                    currentSeries.Appearance.ShowLabels = False
                    oldsubcategory_id = subcategory_id
                End If
                If Not (currentSeries Is Nothing) Then
                    currentSeries.AddItem(DataRow("AMOUNTCUR"), DataRow("TRANSDATE"))
                End If
            Next
        End If
        BarChartForAcc.ChartTitle.TextBlock.Text = "By Month For " & TheYear.ToString

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 03 Jul 2012, 07:18 AM
Hi Henzard,

I have replied to your question in the other support thread you have started. I would suggest to keep the conversation in a single thread so it is easier for both sides to follow.

As I explained there the reason of this behavior is caused of not firing the ItemDataBound event. In order to fire it you need to attach the chart to a DataSource.

All the best,
Peshito
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
henzard
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or