Comments (11)
I had the same problem and after a long time I discovered the cause. I was declaring the library like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
It was me taking out the "min" and it worked. It was like this.
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script>
from laravel-chartjs.
Hi, same problem here. The point is: the error start from nothing, last week works good, today the chart doesn't render, without put the fingers on the code between this weeks. Attached one pic of my console on safari, without errors.
Detail: The charts works well when page doesn't call the chart via ajax, but when calls, i got no render.
Again: works well two weeks ago and stoped from nothing.
I'lll appreciate some help. My config: php7.1 and Laravel 5.4.30.
from laravel-chartjs.
same problem
from laravel-chartjs.
Can you show a snippet of your code or reproduce or show the error? Check also in the console of your browser if there is any javascript error.
from laravel-chartjs.
@ibrunotome, this is a strange problem and I could not simulate it in my environment. Are there any warnings or errors displayed on the browser console? Can you post to me?
from laravel-chartjs.
Hi @fxcosta, no warnings and errors :(
from laravel-chartjs.
Had the same issue. The problem is in addEventListener('DOMContentLoaded'). For different reasons this event is not fired sometimes(in my case it was ajax request for the chart).
@fxcosta Please think about removing generating chart on DOMContentLoaded
P.S. I see that this event was added as a result of the #39 issue.
from laravel-chartjs.
As a workaround you can add something like
var DOMContentLoaded_event = document.createEvent("Event"); DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true); window.document.dispatchEvent(DOMContentLoaded_event);
to ajax call AFTER setting html to your divs with chart (works in Chrome at least.)
from laravel-chartjs.
@fxcosta Do you have time to fix that with the solution above?
from laravel-chartjs.
Has anyone else been successful with this solution? Could you send me a pull request ?? I would be very grateful. I do not have much time lately to study what's going on with this previous event ... I'm sorry!
from laravel-chartjs.
Have the same problem, using Laravel Orchid as admin panel and everthing is lazy loaded with JS so no DOMContentLoaded ever. Would be great to have the option to completely remove this event listener.
from laravel-chartjs.
Related Issues (20)
- Update to ChartJS v3 library HOT 1
- Redirection when I click on the bar HOT 1
- Drill down
- yAxisID not working
- chart render in success function of ajax call HOT 3
- Templates should only be responsible for mapping the state to the UI HOT 4
- bar background color not showing for all rows
- Option OnClick event HOT 1
- Contributor HOT 2
- [ask] add label on pie chart HOT 20
- IE 11 issue
- Generate the same chart in one blade HOT 1
- Mixed Chart
- Duration en X or X axis
- incompatible with laravel 7 HOT 1
- Get Chart js Instances already created HOT 2
- How to add option for animate in controller
- Render markup separately from scripts
- Documentation on how to use this library
- Gradient Fill on Line Chart Background Color
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-chartjs.