title: Laravel Chart need to connect the Database
body: <p>I am developing Training Management system so that it has a data table called <strong>registerdetails</strong> and it consist a data attribute called <strong>trainee_division</strong>,
  so that consist few several divisions and there are trainees who are in under those divisions.
  here is the few divisions
  <strong>INOC,
  INFRA,
  Implementation,
  RAN</strong> so what i need is draw a bar chart on x axis using division names on y axis total count a division.</p>
  
  <p>Here is the incomplete controller</p>
  
  <pre><code>public function division_details()
  {
  
    $chart = Charts::multi('bar', 'chartjs')
  
          -&gt;title("Trainee Divisions")
          -&gt;dimensions(0, 500) 
          -&gt;template("material")
          -&gt;dataset('Trainee', [5,20,100])
          -&gt;labels(['OPERATIONAL', 'INOC', 'Three'])
          -&gt;responsive(false)
          -&gt;Width(0);
  
      return view('registeredusers.divisiondetails', ['chart' =&gt; $chart]);
  }
  </code></pre>
  
  <p>Here is the view for that</p>
  
  <pre><code>`&lt;div class="panel panel-default"&gt;
  &lt;div class="col-md-6 col-md-offset-3"&gt;
  
              &lt;div class="panel-body"&gt;
  
              {!! $chart-&gt;render() !!}
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;/div&gt;`
  </code></pre>
  
  <p>Here is the relevant route.</p>
  
  <p><code>Route::get('DivisionDetails', 'UserRegisterController@division_details');</code></p>
  
  <p>These are the packages um using .</p>
  
  <p>provider as </p>
  
  <pre><code>`Maatwebsite\Excel\ExcelServiceProvider::class,'
  </code></pre>
  
  <p>aliases as</p>
  
  <p><code>'Excel' =&gt; Maatwebsite\Excel\Facades\Excel::class,</code></p>
  
  <p>Can anyone help me to fix this problem.</p>