query("SELECT label FROM tweets WHERE hastag = '$key'")->count(); $labels = $db->query("SELECT label FROM tweets WHERE hastag = '$key' GROUP BY label")->get(); foreach($labels as $label){ $label = $label['label']; $datas[$label] = number_format(($db->query("SELECT label FROM tweets WHERE hastag = '$key' AND label = '$label'")->count() / $total) * 100, 2); } foreach($datas as $index => $val){ if($index == 'positif'){ $warna = '#00a65a'; }elseif($index == 'negatif'){ $warna = '#dd4b39'; }elseif($index == 'netral'){ $warna = '#00c0ef'; } $donutData .= "{ label: '$index', data: $val, color: '$warna' },\n"; $barData .= "['$index', $val],"; } } $db->clear(); ?>

Pilih Data

Hasil Analisis :

Hasil Analisis :

\" + label + '
' + Math.round(series.percent) + '%' } "); endif; include 'view/footer.php'; ?>