Update column chart in ajax panel - don't reset values.

4 posts, 0 answers
  1. Jeff
    Jeff avatar
    5 posts
    Member since:
    Jan 2014

    Posted 31 Jan 2014 Link to this post

    I have a chart with some options next to it. I'd like to have it that when I change the options, it changes the column chart but doesn't start from zero every time.

    So if a value was 6 and it was going to 3, I'd like it to display from 6 -> 3 not 6 -> 0 -> 3.

    TIA - Jeff

    (Used Telerik a couple of years ago and loved it. Got a new job and trying to convince the boss we need it!)
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 03 Feb 2014 Link to this post

    Hi Jeff,

    I am glad to hear you like Telerik UI for ASP.NET AJAX control.

    What I can suggest is that you enable the animations of the RadHtmlChart only on its initial page load and disable them on any other postback through the Transitions property. For example:
    ASPX:
    <asp:UpdatePanel runat="server" ID="panel1">
        <ContentTemplate>
            <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="500" Height="300">
                <PlotArea>
                    <Series>
                        <telerik:ColumnSeries>
                            <SeriesItems>
                                <telerik:CategorySeriesItem Y="30" />
                            </SeriesItems>
                        </telerik:ColumnSeries>
                    </Series>
                </PlotArea>
            </telerik:RadHtmlChart>
            <telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" Text="click" OnClick="RadButton1_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            RadHtmlChart1.Transitions = false;
        }
    }
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        Random rand = new Random();
        (RadHtmlChart1.PlotArea.Series[0] as ColumnSeries).SeriesItems[0].Y = rand.Next(1, 100);
    }

    I have also attached the full VS example to this post.

    Regards,
    Danail Vasilev
    Telerik
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeff
    Jeff avatar
    5 posts
    Member since:
    Jan 2014

    Posted 04 Feb 2014 in reply to Danail Vasilev Link to this post

    That works but now there's no animation which is part of the reason we wanted to use Telerik.
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 07 Feb 2014 Link to this post

    Hello Jeff,

    I am sorry to say that the animation is played for the whole chart and therefore incremental animation is not achievable with the current implementation of RadHtmlChart.

    Regards,
    Danail Vasilev
    Telerik
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top