_Layout.cshtml:
Index.Razor page:
@page "/"
@inject IJSRuntime JS
@code { private async Task SetStock() { await JS.InvokeVoidAsync("createChart", new { canvasId = "myChart1", onAnimationComplete = "function1", chartType= "line", chartData = new { labels = new string[] { "January", "February", "March", "April", "May", "June" }, datasets = new object[] { new { fillColor = "#79D1CF", strokeColor = "#79D1CF", data = new int[] { 60, 80, 81, 56, 55, 40 } } } } }); } }