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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Load dynamic Partial View with Chart OR Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

132211 Aug 21,2017 09:17 AM UTC Aug 23,2017 01:52 PM UTC ASP.NET Core 1
loading
Tags: Chart
tamil
Asked On August 21, 2017 09:17 AM UTC

hi,

      Here, i have to create  chart as a view component but , it should  not load dynamically. here i attached my sample.


layout.html



controller


partial view(_testPartial.cshtml)



index.cshtml


ajax

.0

Dharanidharan Dharmasivam [Syncfusion]
Replied On August 23, 2017 01:52 PM UTC

Hi Tamil, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. We would like to let you know that in the layout page we have specified script manager and other scripts which are required to render the chart control. In the partial view this will not be referred, so the chart will not render. So, in the partial view you need to specify the _Layout.cshtml page as highlighted below. We have prepared a sample for depicting this scenario. Find the code snippet below to achieve this requirement. 

ASP.NET Core: 

Partial View page(chart.cshtml) 

@{ 
    Layout = "~/Views/Shared/_Layout.cshtml"; 
} 

<ej-chart id="container"></ej-chart> 
 
Index.cshtml: 

<button onclick="changeDataSource()">Ajax</button> 
 
function changeDataSource() { 
        $.ajax({ 
            //... 
        }); 
 
    } 

Controller: 
 public ActionResult ChartData() 
        { 
            //... 
            return PartialView("chart"); 
        } 


In the above code example in the ajax request we have returned to partial view where we have rendered simple chart. Also kindly refer the ej.web.all file locally, if you have referred online link, then specify some time delay to render chart control. You can change this with respect to your scenario. 

Screenshot: 
 

Sample for reference can be find from below link. 

If your query is misunderstood at our end, kindly revert us with more information on your query. 

Dharani. 



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

;