fxcosta / laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library
486 stars 112 forks source link

enhancement: Optimize rendering for better web performacne #43

Open kvahuja opened 7 years ago

kvahuja commented 7 years ago

Current Issues:

  1. Currently, the tool needs us to put the Chartjs's JS file in Header.
  2. the scripts are put inline in HTML which is blocking JS and it slows the page down further
kvahuja commented 7 years ago

P.S.: I will try to work on fixes for this.

fxcosta commented 7 years ago

Great!! If you can I would be very grateful! :dancer:

bradgenereux commented 7 years ago

I'm really liking this package, thanks for the great work.

What if you could render the html and js separately. Maybe something like:

{!! $chart1->canvas() !!}
{!! $chart2->canvas() !!}

@push('scripts')
    <script src="chart.js"></script>
    {!! $chart1->js() !!}
    {!! $chart2->js() !!}
@endpush