mariusmuntean / ChartJs.Blazor

Brings Chart.js charts to Blazor
https://www.iheartblazor.com/
MIT License
676 stars 151 forks source link

Has anybody tried to use ChartJs.Blazor.Fork with Net 6.0? #204

Closed Acruval closed 2 years ago

Acruval commented 2 years ago

Describe your question

Even I could get working with NEt Core 3.1 I have problems with Net Core 6.0.

Which Blazor project type is your question related to?

Which charts is this question related to?

all charts

Additional context

[2022-04-11T12:53:39.299Z] Error: Microsoft.JSInterop.JSException: Chart is not defined getDefaultFunc@https://localhost:7053/_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js:74:28 wireUpOptionsOnClick@https://localhost:7053/_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js:79:80 wireUpCallbacks@https://localhost:7053/_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js:64:14 setupChart@https://localhost:7053/_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js:8:18 beginInvokeJSFromDotNet/s<@https://localhost:7053/_framework/blazor.server.js:1:3501 beginInvokeJSFromDotNet@https://localhost:7053/_framework/blazor.server.js:1:3475 _invokeClientMethod/<@https://localhost:7053/_framework/blazor.server.js:1:71773 _invokeClientMethod@https://localhost:7053/_framework/blazor.server.js:1:71759 _processIncomingData@https://localhost:7053/_framework/blazor.server.js:1:69801 Tt/this.connection.onreceive@https://localhost:7053/_framework/blazor.server.js:1:64201 connect/</o.onmessage@https://localhost:7053/_framework/blazor.server.js:1:48517

at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)

at ChartJs.Blazor.Chart.OnAfterRenderAsync(Boolean firstRender)

at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Acruval commented 2 years ago

I reply myself I deleted the 'missed line'

@Begin ChartJsBlazor@ @For time scale before@

   @*Missed line*@
   @*This is the glue between Blazor and Chart.js*@
  <script src="_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js"></script>
@*End ChartJsBlazor*@