Steve
Steve

Reputation: 117

Laravel & ChartJS

Laravel Framework Version: 7.15.0
PHP Version: 7.2.19

I am trying to follow this guide: https://github.com/fxcosta/laravel-chartjs.
I believe the author made it possible to be used on Laravel 7 framework, and I believe it will.

The main issue I am having is that no chart shows up on my test website. After looking in the DevTools, I can clearly see the Canvas and the JS is in place, but it doesn't show up.

I have NPM installed on this project, so I'm not 100% is if I added the script properly in my header. I have it as:
<script src="{{ asset('js/app.js') }}" defer></script>

I made sure I am passing in the $chartjs I created in the controller to the view. But still, nothing shows up.

Is there something I'm missing?


I am using the first example given in the README.md of the Github Repo.

Upvotes: 0

Views: 1072

Answers (2)

IBRAHIM EZZAT
IBRAHIM EZZAT

Reputation: 983

from the mentioned guide :

Finally, for now, you must install and add to your layouts / templates the Chartjs library that can be easily found for download at: http://www.chartjs.org. This setting will also be improved.

so you will need JS and CSS files which you can get from the Link

Upvotes: 1

Steve
Steve

Reputation: 117

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script>

Doesn't explicitly say on the Repo, but we need this.

Upvotes: 0

Related Questions