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

Chart Event After Refresh?

5 Answers 298 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Sean Mars
Top achievements
Rank 1
Sean Mars asked on 21 Oct 2013, 02:40 PM
I am using the kendo.dataviz.ui.Chart via the MVC wrapper. I am looking to fire an operation after the chart refreshes...
$("#mychart").data('kendoChart').refresh();
Once the animations, etc, finishes for the refresh, I would like be notified by a promise or chart event.

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Oct 2013, 12:41 PM
Hi,

You can use the dataBound event.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sean Mars
Top achievements
Rank 1
answered on 23 Oct 2013, 08:15 PM
Thanks Daniel, but I believe that does not fire again unless I have client side datasource bound, which I do not. I call a refresh to resize the charts, not necessarily to get fresh data. I am using server side binding with the MVC wrapper. 
0
Daniel
Telerik team
answered on 25 Oct 2013, 08:43 AM
Hello again,

The event will be triggered when the data is bound on the server as well. The data will be serialized and used for the dataSource.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sean Mars
Top achievements
Rank 1
answered on 22 Nov 2013, 05:08 PM
Maybe the issue is that I do not want to tie the event to the Razor declaration. I was looking to do it from a JavaScript module as such $("#myDropdownList").data("kendoDropDownList").
0
Daniel
Telerik team
answered on 26 Nov 2013, 12:29 PM
Hi,

A handler for the dataBound event can also be bound via JavaScript by using the bind method:
@(Html.Kendo().Chart()
    .Name("chart")
    ...
)
     
<script>
    $(function () {
        var chart = $("#chart").data("kendoChart");
        chart.bind("dataBound", function (e) {
             
        });
    });
</script>



Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Sean Mars
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sean Mars
Top achievements
Rank 1
Share this question
or