RadChart axis and ChartSeries don't update when resubmitting form

Thread is closed for posting
2 posts, 0 answers
  1. Simon
    Simon avatar
    1 posts
    Member since:
    Sep 2012

    Posted 11 Sep 2012 Link to this post

    I'm creating my RadChart progrmatically on postback and making a curve like this,

    Dim radChart As New Telerik.Web.UI.RadChart()
      
    Dim chartSeries2 As New Telerik.Charting.ChartSeries()
    chartSeries2.Type = Telerik.Charting.ChartSeriesType.Line
    chartSeries2.Appearance.LabelAppearance.Visible = False
    chartSeries2.Appearance.LineSeriesAppearance.Color = System.Drawing.ColorTranslator.FromHtml("#123252")
      
    Dim csItem As New Telerik.Charting.ChartSeriesItem
    Dim csItems As New Telerik.Charting.ChartSeriesItemsCollection
      
    For i = 5 To 1000
        csItem = New Telerik.Charting.ChartSeriesItem
        csItem.XValue = i
      
        'lcyNet(i) is calculated each time based on form input values
        csItem.YValue = lcYNet(i)                      
      
        csItems.Add(csItem)
    Next i
      
    chartSeries2.AddItem(csItems)
    radChart.Series.Add(chartSeries2)


    This works perfectly first time, the problem occurs when I change values and resubmit the form. The axis and curve don't update, even though my values and the ChartSeriesItem YValues definitely do.

    I tried adding the current time to the end of the ChartTitle text and that updates OK every time.
  2. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 14 Sep 2012 Link to this post

    Hello Simon,

    I tried to reproduce a scenario like yours but with no avail. Please find attached a sample demonstrating an update of a series item and its properly update when the value is changed runtime.

    Hope this helps.

    Kind regards,
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top