Char is not reset when I clear radchart and series (I add dinamic radchart)

Thread is closed for posting
2 posts, 0 answers
  1. Puertas
    Puertas avatar
    1 posts
    Member since:
    Dec 2010

    Posted 13 Jul 2011 Link to this post

    Hello!

    I add to my page dinamics RadCharts but when I redraw this RadCharts I can change tittle and I can do a invisible legend but I can't reset the series and also I can't change the skin of this RadChart.

    Do you know how I can reset o remove this series? I have tried all of series.Remove() that I see but nothing do well.

    Thanks!

    This is the code that I call when I want to redraw my Radcharts:

     

     

    Dim rcCuadro As New RadChart

     

     

     

    Dim TablaFila As New HtmlTableRow()

     

     

     

    Dim TablaCelda As New HtmlTableCell()

     

    rcCuadro.Clear()

    rcCuadro.Series.RemoveSeries()

    rcCuadro.Chart.Series.RemoveSeries()

    rcCuadro.Chart.Series.ClearItems()

    rcCuadro.Chart.Series.ClearDataBoundState()

    rcCuadro.PlotArea.SeriesCollection.RemoveSeries()

     

    rcCuadro.RemoveAllSeries()

    rcCuadro.Series.ClearDataBoundState()

    rcCuadro.Series.ClearItems()

    rcCuadro.Series.Clear()

    rcCuadro.Series.RemoveSeries()

    rcCuadro.ChartTitle.TextBlock.Text = dvCuadros(i).Item(

     

    "NSERIE")

     

     

     

    Dim FechaFinTemp As DateTime = FechaInicio.AddMonths(-11)

     

    SetXAxis(FechaFinTemp, rcCuadro)

    rcCuadro.PlotArea.XAxis.LayoutMode =

     

    ChartAxisLayoutMode.Between

     

    rcCuadro.PlotArea.YAxis.AutoScale =

     

    False

     

    SetYAxis(rcCuadro)

     

     


    Dim
    CollSerieRM As ChartSeriesCollection = New ChartSeriesCollection(rcCuadro.Chart)

     

     

     

    Dim CollSerieF As ChartSeriesCollection = New ChartSeriesCollection(rcCuadro.Chart)

     

     

     

    Dim SerieActivaRM As ChartSeries = New ChartSeries("RM A", ChartSeriesType.Bar, CollSerieRM)

     

     

     

    Dim SerieActivaF As ChartSeries = New ChartSeries("F A", ChartSeriesType.Bar, CollSerieF)

     

     

     

    Dim SerieReactivaRM As ChartSeries = New ChartSeries("RM A", ChartSeriesType.Bar, CollSerieRM)

     

     

     

    Dim SerieReactivaF As ChartSeries = New ChartSeries("F R", ChartSeriesType.Bar, CollSerieF)

     

    CollSerieRM.Add(SerieActivaRM)

    CollSerieRM.Add(SerieReactivaRM)

    CollSerieF.Add(SerieActivaF)

    CollSerieF.Add(SerieReactivaF)

    SerieActivaRM.Appearance.BarWidthPercent = 50

     

     


    Dim
    FechaTemp As DateTime = FechaInicio.AddMonths(-11)

     

     

     

    While FechaTemp <= FechaInicio

     

     

     

    Dim oTeleastros As New AFEI.afeiNegocio.clsTeleastros

     

     

     

    Dim dvCuadrosMes As DataView

     

     

     


     

    SerieActivaRM.AddItem(

     

    Math.Round("55555,0", 2))

     

    SerieActivaF.AddItem(

     

    Math.Round("58895,6666",2))

     

    SerieReactivaRM.AddItem(

     

    Math.Round("99999,66",2))

     

    SerieReactivaF.AddItem(

     

    Math.Round("152255,888", 2))

     

    rcCuadro.Series.Add(SerieActivaRM)

    rcCuadro.Series.Add(SerieActivaF)

    rcCuadro.Series.Add(SerieReactivaRM)

    rcCuadro.Series.Add(SerieReactivaF)

    rcCuadro.Skin =

     

    "Telerik"

     

    rcCuadro.Width =

     

    "1000"

     

    rcCuadro.Height =

     

    "250"

     

    rcCuadro.Legend.Appearance.Visible =

     

    False

     

    rcCuadro.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

     

    AlignedPositions.Right

     

    rcCuadro.Chart.PlotArea.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

     

    AlignedPositions.BottomRight

     

    rcCuadro.ID =

     

    "rc_" & dvCuadros(i).Item("NSERIE")

     

     

     

    'rcCuadro.DataBind()

     

     

     

     

    Me.Page.Form.Controls.Add(rcCuadro)

     

    TablaCelda.Controls.Add(rcCuadro)

    TablaFila.Cells.Add(TablaCelda)

    TableChart.Rows.Add(TablaFila)

     

    SerieActivaRM =

     

    Nothing

     

    SerieActivaF =

     

    Nothing

     

    SerieReactivaF =

     

    Nothing

     

    SerieReactivaRM =

     

    Nothing

     

  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 15 Jul 2011 Link to this post

    Hello Puertas,

    To see an example of a very similar dynamic layout for the control, please refer to the following example:

    http://demos.telerik.com/aspnet-ajax/chart/examples/programming/addval/defaultcs.aspx

    I hope it gets you started properly.

    Best wishes,
    Yavor
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top