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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to refresh a chart with callbacks

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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.
Thanks,

Julien



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.

Regards,
Vijayabharathi





Sample_9ece8876.zip

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?

Thanks!

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,

 

[C#]

  MVCChartModel chartModel = new MVCChartModel();

  InitializeChart(chartModel);

  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,

 

http://stackoverflow.com/questions/6887697/htmlhelper-in-controller

 

http://stackoverflow.com/questions/621235/using-htmlhelper-in-a-controller

 

Please let us know if we misunderstood your query.

 

Regards,

Vijayabharathi

 

 

 


CONFIRMATION

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.

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

;