We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to refresh a chart with callbacks

Thread ID:





101673 Nov 11,2011 10:05 AM UTC May 23,2012 07:35 AM UTC ASP.NET MVC (Classic) 3
Tags: Chart
Asked On November 11, 2011 10:05 AM UTC


We need to refresh the chart datasource when changing the selected values on comboboxes. I don't want to reload the page. I just need to relaod/replace the partial view where the chart is.


Vijayabharathi K [Syncfusion]
Replied On November 14, 2011 02:33 PM UTC

Hi Julien,

Thanks for using Syncfusion products.

We suggest you to use Ajax to avoid reload the page when selected values on combo boxes. Please refer the attached sample for this query.

Please us know if you have any concern.



Broadcast MAP Limited
Replied On May 22, 2012 10:10 PM UTC

Hi Vijaya,

We're going with another approach to doing our AJAX, and that is the controller returns a JSON object with the generated HTML string, which Javascript will insert it directly into the page.

My question is how do I generate the HTML string within the Controller. In the View, we use something like:
    Html.Syncfusion().Chart("chart_Model", (MVCChartModel)ViewData["ChartModel"])

But this doesn't compile if I put this in the Controller. It doesn't recognize the first Html class/namespace. What is the equivalent syntax I can use?


Vijayabharathi K [Syncfusion]
Replied On May 23, 2012 07:35 AM UTC

Hi Julien,


Thanks for the update.


If your intention is to use html helper in controller means, you can use the below code snippet in controller for chart to achieve this,



  MVCChartModel chartModel = new MVCChartModel();


  ViewData["ChartModel"] = chartModel;

   //html helper in controller

  System.IO.TextWriter writer = new System.IO.StringWriter();

  var html = new HtmlHelper(new ViewContext(ControllerContext, new WebFormView(ControllerContext, "Index"), new ViewDataDictionary(), new TempDataDictionary(), writer), new ViewPage());

  var ChartString = html.Syncfusion().Chart("Chart_Model", chartModel);


Also, please refer the below forum links to know more details for this,






Please let us know if we misunderstood your query.








This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon