public function show($sectorName) { $sectorGraphData = SectorHistoricals::getIndividualSectorGraphData($sectorName, 'last_month', 'Market Cap'); $sectorCaps = \Lava::DataTable(); $sectorCaps->addStringColumn('Date')->addNumberColumn('Sector Cap')->addRows($sectorGraphData); $sectorCapsLava = \Lava::AreaChart('SectorCaps')->dataTable($sectorCaps)->setOptions(['width' => 725, 'height' => 320, 'title' => 'Total Sector Cap (Billions)']); return view('pages.sectors')->with(['sectorCapsLava' => $sectorCapsLava, 'selectedSector' => $sectorName, 'selectedSectorDayChange' => SectorHistoricals::getSelectedSectorDayChange($sectorName), 'sectors' => SectorHistoricals::getSectorDayChanges("sectorDayGain", 30), 'sectorWeekDay' => SectorHistoricals::getSectorWeekDay(), 'stocksInSector' => StockMetrics::getMetricsByStockList(Stock::where('sector', $sectorName)->lists('stock_code'), 'all')]); }