} $chart = new open_flash_chart(); $chart->set_title($title); $chart->add_element($hbar); $step_count = $max_value > 0 ? $max_value / 10 : 1; $x = new x_axis(); $x->set_offset(false); $x->set_steps($max_value / 10); $chart->set_x_axis($x); $y = new y_axis(); $y->set_offset(true); $y->set_labels($y_labels); $chart->add_y_axis($y); if (isset($yaxis_label)) { $y_legend = new y_legend($yaxis_label); $y_legend->set_style('{font-size: 20px; color: #000000}'); $chart->set_y_legend($y_legend); } if (isset($xaxis_label)) { $x_legend = new x_legend($xaxis_label); $x_legend->set_style('{font-size: 20px; color: #000000}'); $chart->set_x_legend($x_legend); } $chart->set_bg_colour("#f3f3f3"); $tooltip = new tooltip(); $tooltip->set_hover(); $tooltip->set_stroke(1); $tooltip->set_colour("#000000"); $tooltip->set_background_colour("#ffffff"); $chart->set_tooltip($tooltip); echo $chart->toPrettyString();
$x->set_offset(false); $xl_tmp = array(); foreach ($dates as $date) { $xl_tmp[] = date('d.m', strtotime($date)); } $x->steps(10); $x->set_labels_from_array($xl_tmp); //DRAW Y AXIS $y = new y_axis(); $y->set_offset(false); $y->set_range(0, $data_max, $data_step); //SET TOOLTIP FORMAT $t = new tooltip(); $t->set_shadow(false); $t->set_stroke(5); $t->set_colour("#cccccc"); $t->set_background_colour("#efefef"); $t->set_body_style("{font-size:10px; font-weight:bold; color:#000000;}"); //PREPARE FINAL CHART AND RETURN IT $chart = new open_flash_chart(); $chart->set_title($title); $chart->add_element($line_1); $chart->add_element($line_5); //moved above to make sure line 2 is above line 5 $chart->add_element($line_2); $chart->add_element($line_3); $chart->add_element($line_4); $chart->set_x_axis($x); $chart->set_y_axis($y); $chart->set_tooltip($t); echo $chart->toPrettyString();
} $chart = new open_flash_chart(); $chart->set_title($title); $chart->add_element($hbar); $step_count = $max_value > 0 ? $max_value / 10 : 1; $x = new x_axis(); $x->set_offset(false); $x->set_steps($max_value / 10); $chart->set_x_axis($x); $y = new y_axis(); $y->set_offset(true); $y->set_labels(array_reverse($y_labels)); $chart->add_y_axis($y); if (isset($yaxis_label)) { $y_legend = new y_legend($yaxis_label); $y_legend->set_style('{font-size: 20px; color: #000000}'); $chart->set_y_legend($y_legend); } if (isset($xaxis_label)) { $x_legend = new x_legend($xaxis_label); $x_legend->set_style('{font-size: 20px; color: #000000}'); $chart->set_x_legend($x_legend); } $chart->set_bg_colour('#f3f3f3'); $tooltip = new tooltip(); $tooltip->set_hover(); $tooltip->set_stroke(1); $tooltip->set_colour('#000000'); $tooltip->set_background_colour('#ffffff'); $chart->set_tooltip($tooltip); echo $chart->toPrettyString();
private function getChart($aGraphs) { $this->prepareData(); $oLabels = new x_axis_labels(); $oLabels->set_labels($this->aData[0]); $oLabels->rotate(-45); $oX = new x_axis(); $oX->set_labels($oLabels); $oX->set_colours('#000000', '#ffffff'); $oChart = new open_flash_chart(); $oChart->set_bg_colour('#FFFFFF'); $oTitle = new title($this->getTitle()); $oTitle->set_style('font-size: 12px; font-weight: bold;'); $oChart->set_title($oTitle); $oTooltip = new tooltip('#val#'); $oTooltip->set_body_style('font-size: 10px'); $oTooltip->set_stroke(1); $oTooltip->set_shadow(true); $oTooltip->set_background_colour('#ffffcc'); $oTooltip->set_colour('#cccc99'); $oChart->set_tooltip($oTooltip); $aY = array(); foreach ($aGraphs as $k => $v) { $y = empty($v['y-right']) ? 0 : 1; $scale = empty($v['scale']) ? 1 : $v['scale']; if (!isset($aY[$y])) { $aY[$y] = new y_axis(); $aY[$y]->set_colours($v['colour'], '#f6f6f6'); } if (empty($v['y-remap'])) { $this->setAxisRange($aY[$y], $k, $scale); } else { $this->remapSeries($aY[$y], $k, $scale); } $oSeries = $this->getSeries($k, $v['type'], $v['colour']); if (!empty($this->drillDown)) { $oSeries->set_on_click($this->drillDown); } $oSeries->set_on_show($v['effect']); if ($y) { $oSeries->attach_to_right_y_axis(); } $aGraphs[$k] = $oSeries; } $oChart->set_x_axis($oX); foreach ($aY as $y => $e) { $method = $y ? 'set_y_axis_right' : 'set_y_axis'; $oChart->{$method}($e); } foreach ($aGraphs as $e) { $oChart->add_element($e); } return $oChart; }
$tab_libelles2[] = $listeJoueurs[$j]['nom']; for ($i = sizeof($listeJeux) - 3; $i < sizeof($listeJeux); $i++) { $data_val2[$i][] = $G_ListeResultatsMoyens[$i][$j]; } } } // Ordonnées $y2 = new y_axis(); $y2->set_range($valmin, $valmax, 5); $y2->set_stroke(2); $y2->set_colour("#d000d0"); // ToolTip $t2 = new tooltip(); $t2->set_shadow(true); $t2->set_stroke(2); $t2->set_colour("#6E604F"); $t2->set_background_colour("#BDB396"); $t2->set_title_style("{font-size: 14px; color: #CC2A43;}"); $t2->set_body_style("{font-size: 10px; font-weight: bold; color: #000000;}"); // titre des absisses //$x_labels = new x_axis_labels(); //$x_labels->set_steps( 1 ); //$x_labels->set_vertical(); //$x_labels->set_labels( $tab_libelles ); //$x_labels->set_vertical(); // Nouveau grAphique $chart2 = new open_flash_chart(); //$posy=0; if (sizeof($listeJeux) > 3) { for ($i = sizeof($listeJeux) - 3; $i < sizeof($listeJeux); $i++) { // $tab_libelles2[] = $listeJeux[$i]['titre'];;
function gsitedata() { $this->autoRender = false; $solid = $this->Session->read('sol'); $host_id = $this->Session->read('host_id'); $tinterval = 3600; $host_srch = ""; if (!empty($host_id) && $host_id != 0) { $host_srch = " AND source_id = " . $host_id; } $this->DnsMessage->recursive = -1; $site_count = $this->DnsMessage->query('SELECT hostname, COUNT(*) FROM dns_messages WHERE sol_id = ' . $solid . $host_srch . ' GROUP BY hostname ORDER BY COUNT(*) DESC LIMIT 50'); //sort($site_count); $data = array(); $x = array(); $max_resp = 0; foreach ($site_count as $site) { $data[] = array((int) $site[0]['COUNT(*)'], 0); if ($max_resp < (int) $site[0]['COUNT(*)']) { $max_resp = (int) $site[0]['COUNT(*)']; } if (empty($site[0]['hostname'])) { $x[] = (string) $site['dns_messages']['hostname']; } else { $x[] = (string) $site[0]['hostname']; } } // joson data format $title = new title(__("Host Popularity", true)); $title->set_style("{font-size: 14px; color: #990000; text-align: center; font-weight:bold;}"); $bar = new bar_stack(); $bar->set_colours(array('#e77919', '#577261')); $bar->set_on_show(new bar_on_show('grow-up', 0, 0.5)); $bar->set_values($data); $bar->set_tooltip('Host: #x_label#<br>Response #val#<br>'); $tooltip = new tooltip(); $tooltip->set_hover(); $tooltip->set_shadow(false); $tooltip->set_stroke(5); $tooltip->set_colour("#6E604F"); $tooltip->set_background_colour("#BDB396"); $data_labels = new x_axis_labels(); $data_labels->rotate(90); $data_labels->set_labels($x); $x_axis = new x_axis(); $x_axis->set_labels($data_labels); $y = new y_axis(); $y->set_range(0, $max_resp * 1.1, (int) ($max_resp / 10)); $chart = new open_flash_chart(); $chart->set_bg_colour('#F9F9F9'); $chart->set_title($title); $chart->add_element($bar); $chart->set_x_axis($x_axis); $chart->set_y_axis($y); $chart->set_tooltip($tooltip); // menu' $m = new ofc_menu("#f0E0ff", "#878787"); $m->values(array(new ofc_menu_item(__('DNS Response', true), 'go_gpage'))); $chart->set_menu($m); header("Content-Type: text/plain"); echo $chart->toPrettyString(); die; }