Charts
I can't make the charts to work:
on this:
@page "/"
<SfChart></SfChart>
<SfChart></SfChart>
and without(with it commented):
@*<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js"></script>*@
I get the error(also see pic error1): blazor.server.js:21 [2021-03-30T10:39:12.941Z] Error: Microsoft.JSInterop.JSException: Cannot read property 'throttle' of undefined
TypeError: Cannot read property 'throttle' of undefined
TypeError: Cannot read property 'throttle' of undefined
with the lodash.min.js uncommented I get at start a reconecting attempt and when i press F12(developer tools): i get a crash in visual studio as well(error 2__1 and error2__2 pics)
Ps i am using latest version as of this writing, specifically: Syncfusion.Blazor version 18.4.0.49
Thanks,
Dan
Attachment: error_faeee75c.zip
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
SM
Srihari Muthukaruppan
Syncfusion Team
March 31, 2021 08:49 AM UTC
Hi Dan,
We have gone through your problem. From that, we request you to kindly include the lodash script in the HEAD element of the ~/Pages/_Host.cshtml page for the server-side Blazor application.
In case, if you are using the WASM application, include it in the HEAD element of the ~/wwwroot/index.html page. This will resolve the reported TypeError: Cannot read property 'throttle' of undefined problem.
Code snippet:
|
Host.cshtml
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js"></script>
</head> |
We suggest you increase the SignalR maximum message size in Startup.cs file to resolve the connection lost issue.
|
Startup.cs
public void ConfigureServices(IServiceCollection services) {
services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 65536;
});
} |
Note: We also suggest you declare properties with get, set accessor to resolve the reported issue. We have also attached the UG link for rendering chart in server side for your reference.
|
Index.razor
public class SalesInfo
{
public string Month { get; set; }
public double SalesValue { get; set; }
} |
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/EmptyChart19.1.54_719452911.zip
Screenshot:
Kindly revert us if you have any concerns.
Regards,
Srihari M
Marked as answer
DM
Dan Mos
March 31, 2021 12:46 PM UTC
Thanks,
It works now. the
services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 65536;
});
part solved it.
SM
Srihari Muthukaruppan
Syncfusion Team
March 31, 2021 02:18 PM UTC
Hi Dan,
Most welcome. Kindly get in touch with us, if you requires further assistance. We are always happy in assisting you.
Thanks,
Srihari
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
DM Dan Mos
- Mar 30, 2021 10:51 AM UTC
- Mar 31, 2021 02:18 PM UTC