@extends('layouts/user_type/auth') @section('content') @php if (!function_exists('getSentimentCounts')) { function getSentimentCounts($path) { if (!file_exists($path)) { return ['positif' => 0, 'netral' => 0, 'negatif' => 0]; } $rows = array_map('str_getcsv', file($path)); array_shift($rows); $labels = array_column($rows, 1); $counts = array_count_values($labels); return array_merge(['positif' => 0, 'netral' => 0, 'negatif' => 0], $counts); } } // Hitung data sekali $base = resource_path('views'); $cDana = getSentimentCounts("{$base}/danalabel.csv"); $cGoPay = getSentimentCounts("{$base}/gopaylabel.csv"); $cShopee = getSentimentCounts("{$base}/shopeepaylabel.csv"); // Total kartu (opsional) $totalPositif = $cDana['positif'] + $cGoPay['positif'] + $cShopee['positif']; $totalNetral = $cDana['netral'] + $cGoPay['netral'] + $cShopee['netral']; $totalNegatif = $cDana['negatif'] + $cGoPay['negatif'] + $cShopee['negatif']; @endphp
Total Positif
Total Netral
Total Negatif
Grafik batang menunjukkan jumlah sentimen positif, netral, dan negatif untuk Dana, GoPay, dan ShopeePay.
Garis menunjukkan perubahan proporsi sentimen (positif, netral, negatif) di setiap e-wallet.
Grafik pai menampilkan persentase sentimen (positif, netral, negatif) untuk e-wallet terpilih.
Tabel ini menunjukkan jumlah dan proporsi sentimen untuk masing-masing e-wallet.
E-Wallet | Positif | Netral | Negatif | Net Score |
---|---|---|---|---|
DANA | {{ $cDana['positif'] }} | {{ $cDana['netral'] }} | {{ $cDana['negatif'] }} | {{ number_format((($cDana['positif'] - $cDana['negatif']) / max(1, $cDana['positif'] + $cDana['netral'] + $cDana['negatif'])) * 100, 1) }}% |
GoPay | {{ $cGoPay['positif'] }} | {{ $cGoPay['netral'] }} | {{ $cGoPay['negatif'] }} | {{ number_format((($cGoPay['positif'] - $cGoPay['negatif']) / max(1, $cGoPay['positif'] + $cGoPay['netral'] + $cGoPay['negatif'])) * 100, 1) }}% |
ShopeePay | {{ $cShopee['positif'] }} | {{ $cShopee['netral'] }} | {{ $cShopee['negatif'] }} | {{ number_format((($cShopee['positif'] - $cShopee['negatif']) / max(1, $cShopee['positif'] + $cShopee['netral'] + $cShopee['negatif'])) * 100, 1) }}% |