本文整理汇总了PHP中graph::set_x_axis_3d方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::set_x_axis_3d方法的具体用法?PHP graph::set_x_axis_3d怎么用?PHP graph::set_x_axis_3d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graph
的用法示例。
在下文中一共展示了graph::set_x_axis_3d方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: return_ofc_day
function return_ofc_day()
{
global $cms, $ps;
$styles =& $cms->theme->styles;
$days = array();
$labels = array();
$data = array();
$data_avg = array();
$sum = 0;
$avg = 0;
$max = 31;
$maxlimit = 100;
// get the last 31 days of data
$list = $ps->db->fetch_rows(1, "SELECT statdate,SUM(connections) connections " . "FROM {$ps->t_map_data} " . "GROUP BY statdate " . "ORDER BY statdate DESC LIMIT {$max}");
$now = $list ? ymd2time($list[0]['statdate']) : time();
while (count($days) < $max) {
$days[date('Y-m-d', $now)] = 'null';
$labels[] = date('M jS', $now);
$now -= 60 * 60 * 24;
}
$days = array_reverse($days);
$labels = array_reverse($labels);
// build our data and labels
$data = $days;
$maxdata = 0;
foreach ($list as $d) {
if (!array_key_exists($d['statdate'], $days)) {
continue;
}
$sum += $d['connections'];
$data[$d['statdate']] = $d['connections'];
$maxdata = max($maxdata, $d['connections']);
}
if ($data) {
$avg = $sum / count($data);
$data_avg[] = $avg;
$data_avg = array_pad($data_avg, count($data), 'null');
$data_avg[] = $avg;
# $data_avg = array_pad(array(), count($data), $avg);
$maxlimit = ceil(ceil($maxdata / 100) * 100);
}
include_once PS_ROOTDIR . '/includes/ofc/open-flash-chart.php';
$g = new graph();
$g->bg_colour = $styles->val('flash.conn.bgcolor', 'flash.bgcolor');
$g->title($styles->val('flash.conn.title', $cms->trans('Daily Connections'), true), '{' . $styles->val('flash.conn.title.style', 'font-size: 16px', true) . '}');
# $g->set_data($data_avg);
# $g->line(1, '#9999ee', 'Average Connections', 9);
# $g->set_data($data);
## $g->line_hollow(1, 3, '#5555ff', 'Connections', 9);
# $g->bar(75, '#5555ff', 'Connections', 9);
$avg_line = new line($styles->val('flash.conn.line.width'), $styles->val('flash.conn.line.color'));
$avg_line->key($styles->val('flast.conn.line.key', $cms->trans('Average Connections'), true), $styles->val('flash.conn.line.size', 9, true));
$avg_line->data = $data_avg;
$conn_bar = new bar_3d($styles->val('flash.conn.bar3d.opacity', 75, true), $styles->val('flash.conn.bar3d.color1', '#5555ff', true), $styles->val('flash.conn.bar3d.color2', '#3333DD', true));
$conn_bar->key($styles->val('flash.conn.bar3d.key', $cms->trans('Connections'), true), $styles->val('flash.conn.bar3d.size', 9, true));
$conn_bar->data = $data;
/*
$keys = array_keys($data);
for ($i=0; $i<count($data); $i++) {
$conn_bar->add_data_tip($data[$keys[$i]],
$cms->trans("Connections: %d", $data[$keys[$i]]) . "<br>" .
$cms->trans("Average: %d", $data_avg[0])
);
}
/**/
$g->set_tool_tip(sprintf($styles->val('flash.conn.tooltip', '#x_label#<br>#key#: #val# (' . $cms->trans('Avg') . ': %d)', true), round($data_avg[0])));
$g->data_sets[] = $avg_line;
$g->data_sets[] = $conn_bar;
$g->set_x_axis_3d(6);
// label each point with its value
$g->set_x_labels($labels);
// $g->set_x_axis_steps(count($labels) / 3 + 1);
// $g->set_x_tick_size(1);
$g->set_x_label_style(10, '#000000', 0, 3, '#cccccc');
// $g->set_x_label_style('none');
# $g->set_x_label_style( 8, '#000000', 2 );
$g->set_inner_background(coalesce($styles->val('flash.conn.bg_inner1', 'flash.bg_inner1'), '#E3F0FD'), coalesce($styles->val('flash.conn.bg_inner2', 'flash.bg_inner2'), '#CBD7E6'), coalesce($styles->val('flash.conn.bg_inner_angle', 'flash.bg_inner_angle'), 90));
$g->x_axis_colour('#909090', '#ADB5C7');
// $g->x_axis_colour('#eeeeee', '#eeeeee');
$g->y_axis_colour('#5555ff', '#eeeeee');
// $g->set_x_offset( false );
// set the Y max
$g->set_y_min(0);
$g->set_y_max($maxlimit);
$g->set_y_legend($styles->val('flash.conn.bar3d.key', $cms->trans('Connections')), 12, $styles->val('flash.conn.bar3d.color1', '#5555ff', true));
print $g->render();
}
示例2: gproducto
function gproducto($anio = '', $departamento = '', $linea = '', $grupo = '')
{
$this->load->library('Graph');
$this->load->library('calendar');
//$this->calendar->generate();
if (empty($anio) or empty($departamento) or empty($linea) or empty($grupo)) {
return;
}
$fechai = $anio . '0101';
$fechaf = $anio . '1231';
$mSQL = "SELECT a.fecha,b.codigo,b.descrip AS nnombre,LEFT(b.descrip,20)AS nombre,e.depto,e.descrip,d.linea,d.descrip,b.grupo,b.descrip,c.nom_grup as ngrupo,\n SUM(a.promedio*a.cantidad) AS costo,\n SUM(a.venta) AS ventas,\n SUM(a.venta)-SUM(a.promedio*a.cantidad) AS ganancias\n FROM {$this->from} ";
foreach ($this->join as $valor) {
$mSQL .= "{$valor['2']} JOIN {$valor['0']} ON {$valor['1']}";
}
$mSQL .= " WHERE a.origen IN ('3I','3M') AND a.fecha>='{$fechai}' AND a.fecha<='{$fechaf}' AND e.depto='{$departamento}' AND d.linea='{$linea}' AND b.grupo='{$grupo}'\n GROUP BY a.codigo ORDER BY ganancias DESC LIMIT 15";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->ganancias > $maxval) {
$maxval = $row->ganancias;
}
$nombre[] = $row->nombre;
$data_1[] = $row->ganancias;
}
$ngrupo = $row->ngrupo;
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#639F45');
$bar_1->key('Ganancias', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
//$bar_1->links[]= site_url("ventas/gananciasproducto/index/$anio/$departamento/".$linea[$i]);
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Ganancias por producto de el grupo ' . $ngrupo . ' en el año ' . $anio, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->set_x_axis_3d(5);
$g->x_axis_colour('#909090', '#ADB5C7');
$g->set_x_labels($nombre);
$g->set_x_label_style(10, '#000000', 2, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Productos', 14, '#004381');
$g->y_axis_colour('#909090', '#ADB5C7');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Producto: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('Ganancia x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ganancias con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例3: graph
function Chart3DBAR($LimiteMaximo = 100, $titulo = "", $titulo2 = "")
{
$data = $this->mValues;
$label = $this->mLabels;
$g = new graph();
$g->title($this->mTitle, '{font-size:16px; color: #FFFFFF; margin: 5px; background-color: #505050; padding:5px; padding-left: 20px; padding-right: 20px;}');
//$g->set_data( $data_1 );
//$g->bar_3D( 75, '#D54C78', '2006', 10 );
//$g->set_data( $data_2 );
//$g->bar_3D( 75, '#3334AD', '2007', 10 );
//Crea el Bar Blue
$bar_blue = new bar_3d(75, '#3334AD');
$bar_blue->key($titulo, 10);
$bar_blue->data = $this->mValues;
$g->data_sets[] = $bar_blue;
if (is_array($this->mValues2)) {
$bar_blue2 = new bar_3d(75, '#ff0000');
$bar_blue2->key($titulo2, 10);
$bar_blue2->data = $this->mValues2;
$g->data_sets[] = $bar_blue2;
}
$g->set_x_axis_3d(12);
$g->x_axis_colour('#909090', '#ADB5C7');
$g->y_axis_colour('#909090', '#ADB5C7');
$g->set_x_labels($this->mLabels);
$g->set_y_max($LimiteMaximo);
$g->y_label_steps(5);
//$g->set_y_legend( 'Open Flash Chart', 12, '#736AFF' );
$x = $g->render();
return $this->setWriteFile($x);
}
示例4: CasesByProcess
function CasesByProcess()
{
$dataSet = $this->getCasesByProcess();
$data = $dataSet['data'];
//$series2 = $dataSet['series2'];
$g = new graph();
$g->title(' Cases by Process ', '{font-size: 14px;}');
$bar_red = new bar_3d(50, '#3334AD');
$bar_red->key('cases', 10);
$bar_red->data = $data;
$g->data_sets[] = $bar_red;
$g->set_x_axis_3d(12);
$g->x_axis_colour('#909090', '#ADB5C7');
$g->y_axis_colour('#909090', '#ADB5C7');
$g->set_x_labels($dataSet['label']);
$g->set_y_max($dataSet['max']);
$g->y_label_steps(6);
echo $g->render();
}
示例5: PostByUserFlash
function PostByUserFlash()
{
$dataSet = $this->getPostByUser();
$data = $dataSet['data'];
$g = new graph();
$g->title(' Posts by User last week ' . date("Y-m-d"), '{font-size: 16px;}');
$max = 1;
foreach ($dataSet['data'] as $k => $val) {
if ($val > $max) {
$max = $val;
}
}
$max = intval($max / 4) * 4 + 4;
$bar_red = new bar_3d(50, '#356aa0');
$bar_red->key('posts', 10);
$bar_red->data = $data;
$bar_blue = new bar_3d(75, '#D54C78');
$bar_blue->key('completed', 10);
$bar_blue->data = $data;
$g->data_sets[] = $bar_red;
//$g->data_sets[] = $bar_blue;
$g->set_x_axis_3d(12);
$g->x_axis_colour('#909090', '#ADB5C7');
$g->y_axis_colour('#909090', '#ADB5C7');
$g->set_x_labels($dataSet['label']);
$g->set_y_max($max);
$g->y_label_steps(4);
$g->set_y_legend('Processmaker', 12, '#736AFF');
echo $g->render();
}