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

Change Series Definitionat runtime?

6 Answers 135 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 25 Aug 2009, 02:57 AM
Is it possible to change like a Line chart to a Bar chart without having to rebind the data?

6 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 27 Aug 2009, 06:24 AM
Hi Albert,

Unfortunately it is not currently possible to do this. We will try to make the necessary improvements in RadChart so that this will work.

Kind regards,
Vladimir Milev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Albert
Top achievements
Rank 1
answered on 27 Aug 2009, 08:34 AM
Thanks, but i already found a way to do it

0
James
Top achievements
Rank 1
answered on 04 Sep 2009, 04:16 PM
Hi Albert, how did you do?
thank you in advance
0
James
Top achievements
Rank 1
answered on 06 Sep 2009, 05:19 AM
I found a way to change chart data series definition at runtime - you just need to create a new DataSeries object and populate it with your list of DataPoint:

Private Sub BuildChart(ByVal type As ChartType)
        chart.DefaultView.ChartArea.DataSeries.Clear()
        Dim dataSerie As New DataSeries()
        Select Case type
            Case ChartType.Bar2D
                dataSerie.Definition = New BarSeriesDefinition()
            Case ChartType.Line2D
                dataSerie.Definition = New LineSeriesDefinition()
            Case ChartType.StackedArea3D
                dataSerie.Definition = New Area3DSeriesDefinition()
        End Select
        For Each data As ChartDataViewModel In Model.ChartElementDataList
            dataSerie.Add(New DataPoint() With {.XCategory = data.ChartXY.X.ToString(), .YValue = CDbl(data.ChartXY.Y)})
        Next
        chart.DefaultView.ChartArea.DataSeries.Add(dataSerie)       
    End Sub
0
Nuno Ferreira
Top achievements
Rank 1
answered on 23 Apr 2010, 04:54 PM
It's already possible? I'm using RadControls for Silverlight v. 2010.1.309, but can't find a way to change chart type at runtime.
0
Tim
Top achievements
Rank 1
answered on 29 Nov 2010, 09:13 PM
Any news on this?

Tim
Tags
Chart
Asked by
Albert
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Albert
Top achievements
Rank 1
James
Top achievements
Rank 1
Nuno Ferreira
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Share this question
or