//header fontsize $y_max = max($dataraw); $y_max = $y_max < 10 ? 10 : ceil($y_max / 5) * 5; $step = $y_max < 20 ? 2 : 5; if ($y_max > 10) { $y_max += $step; } $tags = new ofc_tags(); $tags->font("Verdana", $xfs)->align_x_center()->text('#y#')->style(true, false, false, 1); $x = 0; foreach ($data as $key => $v) { $tags->append_tag(new ofc_tag($x, $v->top, $statuscolor[$key])); $x++; } $bar = new bar_3d(); $bar->set_values(array_values($data)); $chart->add_element($bar); $chart->add_element($tags); //x-label $xal = new x_axis_labels(); $tmp = array(); foreach ($statustext as $status => $text) { $tmp[] = new x_axis_label($text, $statuscolor[$status], $xfs, 15); } $xal->set_labels($tmp); $xal->set_size($xfs); $x = new x_axis(); $x->set_offset(true); $x->set_labels($xal); $x->set_3d(5); $x->colour = '#909090';
case "cost": $title = $locate->Translate("Reseller Cost"); $data[] = intval($ary['resellercredit']); break; case "gain": $title = $locate->Translate("Markup"); $data[] = intval($ary['markup']); break; } } } } $title = new title($title); $title->set_style("{font-size: 20px; color: #A2ACBA; text-align: center;}"); $bar = new bar_3d(); $bar->set_values($data); $bar->colour = '#D54C78'; $x_labels = new x_axis_labels(); $x_labels->set_labels($x_date); $x_axis = new x_axis(); $x_axis->set_3d(3); $x_axis->colour = '#909090'; $x_axis->set_labels($x_labels); $x_legend = new x_legend($x_title); $x_legend->set_style('{font-size: 20px; color: #778877}'); $y_axis = new y_axis(); $max = arr_max($data); $mix = arr_min($data); $per = round($max / 10); $max = round($max + $per + $per); $temp = '$y_axis->set_range(0,' . $max . ',' . $per . ');';
$result = mssql_query($sql); $data = array(); if (mssql_num_rows($result) > 0) { while ($val = mssql_fetch_assoc($result)) { $rt[] = 'RT ' . $val['RT']; $jumlah[] = $val['Jumlah']; $total = $val['total']; $tempJumlah = $val['Jumlah']; $maxJumlah = $maxJumlah > $tempJumlah ? $maxJumlah : $tempJumlah; } } $max = 0; $title = new title('Jumlah Data Peserta KB Per RT, RW ' . $aRw[$_REQUEST['rwId']]['nama'] . ' Total : ' . $total . ' ( ' . date("D M d Y") . ' ) '); $title->set_style('{font-size:15px; color: #bcd6ff; margin:0px; background-color: #5E83BF;}'); $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($rt); $y_base = new y_axis_base(); $y_base->set_range(0, $maxJumlah + round($maxJumlah / 2), round($maxJumlah / 10)); $x = new x_axis(); $x->set_labels($labels); $x->set_3d(5); $y = new y_axis(); $y->set_labels($y_labels); $tags = new ofc_tags(); $tags->font('Verdana', 10)->colour('#000000')->align_x_center()->text('#y#'); $i = 0; foreach ($jumlah as $j) {
if ($tmp[1] * -1 == 0) { $bar->set_colour('#FFFFFF'); } else { if ($tmp[1] * -1 > 0) { $bar->set_colour('#000000'); } else { if ($tmp[1] * -1 < 0) { $bar->set_colour('#900000'); } } } $datalist[] = $bar; } $title = new title("This month budget over/under"); $bar = new bar_3d(); $bar->set_values($datalist); $bar->set_tooltip('$#val#'); $y = new y_axis(); $y->set_range(round($min * 1.2), round($max * 1.2)); $y->set_steps(count($datalist) * 2); $y->set_label_text("\$#val#"); $x_labels = new x_axis_labels(); $x_labels->rotate(45); $x_labels->set_labels($labellist); $x = new x_axis(); $x->set_labels($x_labels); $chart = new open_flash_chart(); $chart->set_title($title); $chart->add_element($bar); $chart->set_x_axis($x); $chart->set_y_axis($y);