This is a migrated thread and some comments may be shown as answers.

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

3 Answers 65 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 31 Jan 2014, 08:30 PM
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!)

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 03 Feb 2014, 03:05 PM
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.
0
Jeff
Top achievements
Rank 1
answered on 04 Feb 2014, 03:10 PM
That works but now there's no animation which is part of the reason we wanted to use Telerik.
0
Danail Vasilev
Telerik team
answered on 07 Feb 2014, 10:16 AM
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.
Tags
Chart (HTML5)
Asked by
Jeff
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or