public function show(SearchRequest $request) { $stocks = StockMetrics::getMetricsByStockList($this->search->getSearchResults($request), $request->omitCondition); if ($request->viewType == 'partial') { if ($request->section == 'sectorDayGain' || $request->section == 'sectorDayLoss') { return view('layouts.partials.sector-day-change-display')->with(['sectorChanges' => SectorHistoricals::getSectorDayChanges($request->section), 'title' => SectorHistoricals::getSectorDayChangeTitle($request->section)]); } return view('layouts.partials.stock-list-display')->with(['stocks' => $stocks]); } return view('pages.stocks')->with(['stocks' => $stocks, 'stockSectors' => Stock::getSectorDropdown(), 'stockSectorName' => $request->stockSector]); }
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')]); }
public function sectorDayChanges($sectorName) { return view('layouts.partials.all-sectors-day-change-display')->with(['selectedSector' => $sectorName, 'sectors' => SectorHistoricals::getSectorDayChanges("sectorDayGain", 30), 'sectorWeekDay' => SectorHistoricals::getSectorWeekDay()]); }