Change Series Definitionat runtime?

7 posts, 0 answers
  1. Albert
    Albert avatar
    65 posts
    Member since:
    Aug 2008

    Posted 24 Aug 2009 Link to this post

    Is it possible to change like a Line chart to a Bar chart without having to rebind the data?
  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 27 Aug 2009 Link to this post

    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.
  3. Albert
    Albert avatar
    65 posts
    Member since:
    Aug 2008

    Posted 27 Aug 2009 Link to this post

    Thanks, but i already found a way to do it

  4. James
    James avatar
    47 posts
    Member since:
    Jun 2009

    Posted 04 Sep 2009 Link to this post

    Hi Albert, how did you do?
    thank you in advance
  5. James
    James avatar
    47 posts
    Member since:
    Jun 2009

    Posted 06 Sep 2009 Link to this post

    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
  6. Nuno Ferreira
    Nuno Ferreira avatar
    8 posts
    Member since:
    Apr 2010

    Posted 23 Apr 2010 Link to this post

    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.
  7. Tim
    Tim avatar
    169 posts
    Member since:
    Apr 2008

    Posted 29 Nov 2010 Link to this post

    Any news on this?

    Tim
Back to Top