score:0

yes you can do it in this way.

have a method something like

generatechart(data){
//all the chart related stuff
}

in ajax call success call back make a call to the generatechart method with the data you have got

$.ajax({
               type: "post",
               url: "/chart/ajax_get_chart", // the url of the controller action method
               data: null, // optional data
               success: function(response) {
                  generatechart(response)
               },                
               error : function(req, status, error) {
                    // do something with error   
               }
           });

so fially the data in the model, ajax call in the controller and the geratechart will give you the view.

hope this will help.


Related Query

More Query from same tag