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. Image for the cookie policy date
close icon

Refresh Chart in PartialView

Hello,
I am trying to refresh the data within a chart defined in a partial view. The initial call
to  @{Html.RenderPartial("_SummaryChart");} generates a javascript error Uncaught ReferenceError: $ is not defined which prevents the chart being display.
Subsequnetly clicking the Update button shows the chart correctly.

I tried using load etc but was unable to overcome the error.
The examples I found on the forum seem to be prior to .NET Core 1.1 and vs2017.
Any ideas please ?
Thanks



Attachment: RefreshChart_eeca3c33.zip

4 Replies

MU mumfie October 3, 2017 06:34 PM UTC

To overcome error I have changed main view to use @Html.Partial("_SummaryChart") instead and reordered the included scripts so jquery.js is included prior to the chart.

I would however be interested to see recommended solution to refresh chart.



SK Saravana Kumar Kanagavel Syncfusion Team October 4, 2017 11:46 AM UTC

Hi Colin, 
 
Thanks for contacting Syncfusion Support. 
 
We have analyzed your query and tried to reproduce the reported issue in our sample but not able to reproduce the reported issue at our end. In the sample ,we have rendered the chart using partial view. 
 
Please refer the code example below 
 
[Partial.cshtml] 
 
@{Html.RenderPartial("Index");} 
 
[Index.cshtml] 
 
<div> 
    <ej-chart id="container"> 
    </ej-chart> 
</div> 
 
 
And we have prepared the sample using partial view for your reference and attached in the below location. 
 
  
Please find the output of the sample below 
 
 
 
And if you still face any concern, kindly revert us with issue reproducing runnable sample or modified the attached sample along with replication steps to provide the exact solution sooner. 
 
Please let us know if you have any concern. 
 
Regards, 
Saravana Kumar K. 



MU mumfie October 4, 2017 03:42 PM UTC

Thank you for the sample. It seems to be working now. I had to move the jquery include file nearer to top of page.

The error was on a page containing numerous other third party jquery components from different vendors.

Thanks




SK Saravana Kumar Kanagavel Syncfusion Team October 5, 2017 06:35 AM UTC

Hi Colin, 
 
Thanks for your update. 
 
Please let us know if you need any other assistance on this. 
 
Regards, 
Saravana Kumar K. 


Loader.
Live Chat Icon For mobile
Up arrow icon