title: Laravel 5.5 Console TV Bar Chart High Charts multipleDatasets and label
body: <p>I have a <strong>Laravel 5.5</strong> app that used this <a href="https://github.com/ConsoleTVs/Charts" rel="nofollow noreferrer">ConsoleTV Chart Package</a> I used a <strong>barchart</strong> to visualize my <strong>data</strong> in a <strong>monthly report basis</strong>. I have the following query below.</p>
  
  <pre><code>$dt = Carbon::now()-&gt;year;
          $anRequest = AnalysisRequest::where(DB::raw("(DATE_FORMAT(created_at,'%Y'))"),date('Y'))-&gt;orderBy('service_id') 
                          -&gt;get();
  </code></pre>
  
  <p>and in my <strong>chart</strong></p>
  
  <pre><code>$barChart = Charts::database($anRequest, 'bar', 'highcharts')
                    -&gt;title("Monthly service request")
                    -&gt;elementLabel("Total requests")
                    -&gt;dimensions(1000, 500)
                    -&gt;responsive(false)
                    -&gt;groupByMonth(date('Y'), true);
  </code></pre>
  
  <p>This code is working perfectly fine and display all the data in by <strong>month</strong> but how can I add another <code>dataSets</code> or <code>multipleDataSets</code> instead of just having one <strong>sets of data</strong> to <strong>visualize</strong>.</p>
  
  <p>For example I will have another query from the <strong>AnalysisRequest</strong> but with a specific <strong>resources</strong>.</p>
  
  <p>Sample code below using <strong>multi</strong></p>
  
  <p>The <strong>query</strong></p>
  
  <pre><code> $tags_jan = DB::table('tags')-&gt;whereYear('created_at', $dt)-&gt;whereMonth('created_at', '1')-&gt;count();
  
           $tags_feb = DB::table('tags')-&gt;whereYear('created_at', $dt)-&gt;whereMonth('created_at', '2')-&gt;count();
  
           $tags_mar = DB::table('tags')-&gt;whereYear('created_at', $dt)-&gt;whereMonth('created_at', '3')-&gt;count();
  // and the list goes on which is bad
  </code></pre>
  
  <p>The <strong>charts</strong> using <strong>multi</strong></p>
  
  <pre><code>$chart = Charts::multi('bar', 'highcharts')
              // Setup the chart settings
              -&gt;title("Total Reports for this year")
              // A dimension of 0 means it will take 100% of the space
              -&gt;dimensions(0, 400) // Width x Height
              // This defines a preset of colors already done:)
              // -&gt;template("material")
              // -&gt;responsive(true)
              // You could always set them manually
              // -&gt;colors(['#2196F3', '#F44336', '#FFC107'])
              // Setup the diferent datasets (this is a multi chart)
              -&gt;colors(['green', 'aqua', 'red', 'yellow'])
              -&gt;dataset('Ads', [$ads_jan,$ads_feb,$ads_mar,$ads_apr,$ads_may,$ads_june,$ads_july,$ads_aug,$ads_sept,$ads_oct,$ads_nov,$ads_dec])
  
              -&gt;dataset('Channels', [$channels_jan,$channels_feb,$channels_mar,$channels_apr,$channels_may,$channels_june,$channels_july,$channels_aug,$channels_sept,$channels_oct,$channels_nov,$channels_dec])
  
              -&gt;dataset('Shows', [$shows_jan,$shows_feb,$shows_mar,$shows_apr,$shows_may,$shows_june,$shows_july,$shows_aug,$shows_sept,$shows_oct,$shows_nov,$shows_dec])
  
              -&gt;dataset('Tags', [$tags_jan,$tags_feb,$tags_mar,$tags_apr,$tags_may,$tags_june,$tags_july,$tags_aug,$tags_sept,$tags_oct,$tags_nov,$tags_dec])
  </code></pre>
  
  <p>This code above also works fine but as you can see in the <strong>variable</strong> I am querying for each month for this year which is isn't quite good. How can I simplified this <strong>query</strong> or another way to solve this using multiple <strong>dataSets</strong>?</p>
  
  <p>Appreciate if someone could help.
  Thanks in advance.</p>