mariusmuntean / ChartJs.Blazor

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

How to use ChartJs.Blazor in my app? #139

Closed ZedZipDev closed 4 years ago

ZedZipDev commented 4 years ago

I have an Bazor web server app project. Add the 2nd project ChartJs.Blazor. It is compiled, I run it: no any charts but exceptions

info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: D:\MyProjects\PM2020\PMan\PropMan
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: Could not find 'ChartJsInterop' in 'window'.
Error: Could not find 'ChartJsInterop' in 'window'.
    at https://localhost:5001/_framework/blazor.server.js:8:30944
    at Array.forEach (<anonymous>)
    at p (https://localhost:5001/_framework/blazor.server.js:8:30904)
    at https://localhost:5001/_framework/blazor.server.js:8:31614
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:8:31587)
    at https://localhost:5001/_framework/blazor.server.js:1:20052
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:20022)
    at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:18006)

How to fix it?

ZedZipDev commented 4 years ago

Solved