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

HtmlChart and Ajax

2 Answers 121 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Tom Glover
Top achievements
Rank 1
Tom Glover asked on 16 Jul 2012, 04:35 PM
Hi

I'm trying to refresh a set of HtmlCharts on my page in an ajax-style manner i.e. without reloading the whole page. The charts are populated manually in code using a method similar to that shown in http://demos.telerik.com/aspnet-ajax/htmlchart/examples/serversideapi/programmaticcreation/defaultcs.aspx.

I'd like to know if it is possible to refresh an HtmlChart using Ajax and the RadAjaxManager? I haven't succeeded yet since it seems to crash the browser (Firefox 13.0.1) when I try. This may be an SVG/browser issue, but I'd like to know if it ought to work?

Alternatively is it possible to use the loadData() method from javascript and repopulate the chart with data as in the 'Programmatic Creation' sample? I can't see any events available server side to respond to loadData() but I'm not sure how the loadData binding works, so again I'm not sure if I'm going down the wrong path here.

Any suggestions appreciated
Thanks
Tom

2 Answers, 1 is accepted

Sort by
0
SC
Top achievements
Rank 2
answered on 18 Jul 2012, 05:13 PM
Hi,
I am also curious as how this works. Currently when i have a postback due to some selection changes the chart just vanishes and other controls just stop working (eg a tabstrip the chart is in).
0
Slav
Telerik team
answered on 19 Jul 2012, 11:36 AM
Hi guys,

I tried to reproduce the problem you described, but without success. Please take a look at my test page, compare it with your setup and let me know if there are differences. Basically I have used the implementation from the online demo HtmlChart / Programmatic Creation and I have replaced the UpdatePanel with a RadAjaxManager. The effect appears to be the same as shown in this screen capture.

As explained in the Client-side API help article, the method loadData invokes a light callback to the server in order to send the chart data to the client, which allows you to populate RadHtmlChart after the page is loaded. If you want to change the data that is loaded in the RadHtmlChart control, you will have to initiate an AJAX request to the server in order to specify the new datasource.

Please check the attached sample and describe the changes that should be made in order to recreate your scenario. If this is not possible, you can also prepare and send a simple, runnable page that isolates the problem so that I can examine it locally and provide a concrete solution.

Greetings,
Slav
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.
Tags
Chart (HTML5)
Asked by
Tom Glover
Top achievements
Rank 1
Answers by
SC
Top achievements
Rank 2
Slav
Telerik team
Share this question
or