@extends('layouts.sentara') @section('content')
{{-- ALERT --}} @if(!$hasAnalisis)
Data ulasan sudah tersedia, tetapi belum dilakukan analisis sentimen.
@endif {{-- DROPDOWN PERIODE --}}
Periode Analisis:
@if($periodeAktif) Data dianalisis: {{ \Carbon\Carbon::parse($periodeAktif->created_at)->format('d M Y') }} @endif
{{-- Statistik Cards --}}

Total Ulasan

{{ $stats['total'] }}

Sentimen Positif

{{ $stats['positif_persen'] }}%

Sentimen Negatif

{{ $stats['negatif_persen'] }}%

Sentimen Netral

{{ $stats['netral_persen'] }}%

{{-- Chart Section --}}
{{-- PIE CHART --}}

Distribusi Sentimen

{{-- BAR CHART - PURE HTML --}} {{-- BAR CHART - PURE HTML VERTICAL --}}

Sentimen per Destinasi

{{-- Legend --}}
Positif Negatif Netral
@php $maxVal = 1; foreach($chartDestinasi as $item) { $maxVal = max($maxVal, $item->positif, $item->negatif, $item->netral); } @endphp
@foreach($chartDestinasi as $item) @php $hPos = round(($item->positif / $maxVal) * 180); $hNeg = round(($item->negatif / $maxVal) * 180); $hNet = round(($item->netral / $maxVal) * 180); $label = strlen($item->wisata) > 12 ? substr($item->wisata, 0, 12) . '...' : $item->wisata; @endphp
{{-- Positif --}}
{{ $item->positif }}
{{-- Negatif --}}
{{ $item->negatif }}
{{-- Netral --}}
{{ $item->netral }}

{{ $label }}

@endforeach
{{-- Section Bawah --}}

Total Data per Destinasi

@foreach($totalPerWisata as $item)
{{ $item->wisata }} {{ $item->total }} ulasan
@endforeach

Word Cloud

@include('analisis.index')
@include('rekomendasi.index')
{{-- SCRIPTS --}} @endsection