public function sectorCapsPieChart($numberOfSectors)
 {
     $graphData = SectorHistoricals::getAllSectorGraphData($numberOfSectors);
     $sectorCaps = \Lava::DataTable();
     $sectorCaps->addStringColumn('Sector Name')->addNumberColumn('Percent')->addRows($graphData);
     return $sectorCaps->toJson();
 }
 public function index()
 {
     //Line graph for market cap
     $totalMarketCapGraphData = SectorHistoricals::getIndividualSectorGraphData('All', 'last_month', 'Market Cap');
     $marketCaps = \Lava::DataTable();
     $marketCaps->addStringColumn('Date')->addNumberColumn('Market Cap')->addRows($totalMarketCapGraphData);
     $marketCapsLava = \Lava::AreaChart('MarketCaps')->dataTable($marketCaps)->setOptions(['width' => 725, 'height' => 360, 'title' => 'ASX Market Cap (Billions)']);
     //PieChart for Sectors' Market Caps
     $individualSectorCapsGraphData = SectorHistoricals::getAllSectorGraphData('top_5');
     $sectorCaps = \Lava::DataTable();
     $sectorCaps->addStringColumn('Sector Name')->addNumberColumn('Percent')->addRows($individualSectorCapsGraphData);
     $sectorCapsLava = \Lava::PieChart('Sectors')->dataTable($sectorCaps)->customize(['tooltip' => ['text' => 'percentage']])->setOptions(['width' => 725, 'height' => 360, 'title' => 'Sector Caps (Billions)', 'pieSliceText' => 'label']);
     return view('pages.home')->with(['marketCapsLava' => $marketCapsLava, 'sectorDayGains' => SectorHistoricals::getSectorDayChanges('sectorDayGain'), 'sectorDayLosses' => SectorHistoricals::getSectorDayChanges('sectorDayLoss'), 'sectorDayGainTitle' => SectorHistoricals::getSectorDayChangeTitle('sectorDayGain'), 'sectorDayLossTitle' => SectorHistoricals::getSectorDayChangeTitle('sectorDayLoss')]);
 }