$data = array();
if (mssql_num_rows($result) > 0) {
    while ($val = mssql_fetch_assoc($result)) {
        $jenis[] = $val['Jenis'];
        $jumlah[] = $val['Jumlah'];
        $total = $val['total'];
        $data[] = new pie_value($val['Jumlah'], $val['Jenis'] == null ? 'Tidak KB' : $val['Jenis']);
        //$tempJumlah = $val[ 'Jumlah' ];
        //$maxJumlah = ( $maxJumlah > $tempJumlah ) ? $maxJumlah : $tempJumlah;
    }
}
$max = 0;
$title = new title('Jumlah Pemakaian Alat Kontrasepsi Berdasarkan Jenis, Total : ' . $total . ' ( ' . date("D M d Y") . ' ) ');
$title->set_style('{font-size:20px; color: #bcd6ff; margin:0px; background-color: #5E83BF;}');
$pie = new pie();
$pie->alpha(0.5)->add_animation(new pie_fade())->add_animation(new pie_bounce(5))->start_angle(0)->tooltip('#val# dari #total#<br>#percent# dari 100%')->colours(array('#d01f3c', '#356aa0', '#c79810', '#639bf7', '#ac77dea'));
$pie->set_values($data);
/*$bar = new bar_3d();
	$bar->set_values( $jumlah );	
	$bar->colour = '#9999FF';	
	$bar->set_on_show( new bar_on_show( 'grow-up', 1, 0 ) );

	$labels = new x_axis_labels();
	$labels->set_labels( $jenis );

	$y_base = new y_axis_base();
	$y_base->set_range( 0, $maxJumlah + round( $maxJumlah / 2 ), round( $maxJumlah / 2 ) );

	$x = new x_axis();
	$x->set_labels( $labels );
	$x->set_3d( 5 );