我正在使用 blazor 服务器端并尝试使用 Blazor.Chartjs 显示图表。我的问题是我有用户输入日期的表单,应用程序将从数据库中获取具有所选日期的数据。第一次显示图表但是当用户更改日期并且我想用新数据更改图表但是我有这个错误:
Unhandled exception rendering component: Could not find a chart with the given id. c4e7005b-e203-46f1-9719-68c6d14d848f
Microsoft.JSInterop.JSException: Could not find a chart with the given id. c4e7005b-e203-46f1-9719-68c6d14d848f
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit '268yoqwqVBLFanukxnq3R4LjrnKrEAgIdVkQSPnIgfY'.
Microsoft.JSInterop.JSException: Could not find a chart with the given id. c4e7005b-e203-46f1-9719-68c6d14d848f
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Run Code Online (Sandbox Code Playgroud)