How do I clear/reset a chart

5 posts, 0 answers
  1. Steven
    Steven avatar
    32 posts
    Member since:
    Jul 2012

    Posted 16 Jul 2012 Link to this post

    I have an html chart that I generate some series for based on whatever is selected in a combobox. How do I reset the chart when I have new data for it?

    I pretty much add the series myself.





    the other chart control has a clear() method, but I am not seeing it here.

    RadHtmlChart1.PlotArea.Series.Clear(); doent seem to work either.


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Jul 2012 Link to this post

    Hi Steven,

    Following is the code that I tried to clear the series on a Button click. Clear method is working as expected at my end.

    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server"></telerik:RadHtmlChart>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" />

    protected void Page_Load(object sender, EventArgs e)
       ColumnSeries series1 = new ColumnSeries();
       series1.Name = "IE";
       series1.Stacked = true;
       SeriesItem SeriesItem11 = new SeriesItem();
       SeriesItem11.YValue =0;
       SeriesItem SeriesItem12 = new SeriesItem();
       SeriesItem12.YValue = 0;
       SeriesItem SeriesItem13 = new SeriesItem();
       SeriesItem13.YValue = 48;
       SeriesItem SeriesItem14 = new SeriesItem();
       SeriesItem14.YValue = 41;
       SeriesItem SeriesItem15 = new SeriesItem();
       SeriesItem15.YValue = 34;
    protected void Button1_Click(object sender, EventArgs e)

    Please provide your code where I can replicate your problem locally if it doesn't helps.

  3. Steven
    Steven avatar
    32 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2012 Link to this post

    I figured it out, I also had to do a



  4. Qurat
    Qurat avatar
    21 posts
    Member since:
    Jan 2013

    Posted 25 Feb 2013 Link to this post

    just simply add this line it will clear the previous data 
    after that databind again to new value

    @nnu shah
    Punjab lokh sujag
  5. Rob
    Rob avatar
    3 posts
    Member since:
    Dec 2012

    Posted 04 Aug 2013 Link to this post

    This is what did it for me as well! Thanks for posting.  :)

Back to Top