当前位置: 首页>>代码示例>>PHP>>正文


PHP graph::line_hollow方法代码示例

本文整理汇总了PHP中graph::line_hollow方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::line_hollow方法的具体用法?PHP graph::line_hollow怎么用?PHP graph::line_hollow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在graph的用法示例。


在下文中一共展示了graph::line_hollow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mkCacheData

 function mkCacheData($date_from, $date_to, $product_id)
 {
     $conditions = array();
     $info = $this->dbstuff->GetRow("SELECT * FROM " . $this->table_prefix . "products WHERE id='" . $product_id . "'");
     if (!empty($info)) {
         $_GET['pn'] = $info['name'];
     }
     $mdt = date("Ymd") . "_" . substr(md5($_GET['pn'] . $_GET['ds'] . $_GET['de']), 0, 6);
     $file_item = $mdt;
     $file_path = DATA_PATH . "tmp/" . $file_item . $this->cache_ext;
     if (!file_exists($file_path)) {
         // use the chart class to build the chart:
         include_once LIB_PATH . 'ofc/chart.php';
         $g = new graph();
         $result = $this->dbstuff->GetArray("SELECT DATE_FORMAT(FROM_UNIXTIME(created),'%m') as mn,avg(max_price) AS avmax,avg(min_price) AS avmin FROM " . $this->table_prefix . "quotes WHERE product_id=" . $product_id . " AND created BETWEEN {$date_from} AND {$date_to} group by mn ORDER BY created ASC");
         if (!empty($result)) {
             foreach ($result as $val) {
                 $data[] = floor(($val['avmax'] + $val['avmin']) / 2);
             }
             $title = L("stat_charts", "tpl") . $_GET['ds'] . L("arrive_to", "tpl") . $_GET['de'];
         } elseif ($info['name']) {
             $title = $info['name'];
         } else {
             $title = L("data_not_exists") . df();
         }
         $g->title($title, '{font-size: 24px;color: #0000FF}');
         $g->set_data($data);
         $g->line_hollow(2, 4, '0x80a033', $_GET['pn'], 10);
         // label each point with its value
         //$g->set_x_labels( explode(",", L("months", "tpl")) );
         $x_result = $this->dbstuff->GetArray("select CONCAT(FROM_UNIXTIME(created, '%Y'),'/',FROM_UNIXTIME(created, '%m')) as m from " . $this->table_prefix . "quotes WHERE created BETWEEN {$date_from} AND {$date_to} group by DATE_FORMAT(FROM_UNIXTIME(created),'%m') ORDER BY created ASC");
         foreach ($x_result as $val) {
             $x_tmp[] = $val['m'];
         }
         $g->set_x_labels($x_tmp);
         $label_y = $this->dbstuff->GetRow("select max(max_price) as price_max,min(min_price) as price_min from " . $this->table_prefix . "quotes WHERE product_id=" . $product_id . " AND created BETWEEN {$date_from} AND {$date_to}");
         $y_max = !empty($label_y['price_max']) ? $label_y['price_max'] : 100;
         // set the Y max
         $this->max_price = $label_y['price_max'];
         $this->min_price = $label_y['price_min'];
         $g->set_y_max($label_y['price_max']);
         // label every 20 (0,20,40,60)
         $g->y_label_steps(6);
         // display the data
         file_put_contents($file_path, $g->render());
     }
     $this->cache_datafile = $file_item . $this->cache_ext;
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:48,代码来源:quote.php

示例2: date

  	$data_2[] = $row['vr_custo'];
  	$data_3[] = $row['vr_totalvenda']-$row['vr_custo'];
  	
  	$labels[] = date('d/m/Y',strtotime($row['data_venda']));

  	$max_value = ($max_value<$row['vr_totalvenda'])?$row['vr_totalvenda']:$max_value;
  	
}


$g = new graph();

$g->set_data( $data_1 );
$g->set_data( $data_2 );
$g->set_data( $data_3 );

$g->line_hollow( 3, 5, '0x9933CC', 'Venda', 10 );
$g->line_hollow( 3, 5, '0xCC3399', 'Custo', 10);    // <-- 3px thick + dots
$g->line_hollow( 3, 5, '0x80a033', 'Lucro', 10 );

$g->set_x_labels( $labels );
$g->set_x_label_style( 10, '0x000000', 0, 2 );

$g->set_y_max( $max_value );
$g->y_label_steps( 4 );
$g->set_y_legend( 'Valores em Real - R$', 12, '#000000' );
$g->bg_colour = '#FFFFFF';

echo $g->render();

?>
开发者ID:renatomarinho,项目名称:ASC,代码行数:31,代码来源:chart_venda_lucratividade_vendedor.php

示例3: graph

$resubmit = $PHP_SELF . "?" .  $_SERVER['QUERY_STRING'];

$g = new graph();
$g->title( $title, '{font-size: 18px; color: #A0A0A0;}' );
$g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 );
$g->bg_colour = '#FFFFFF';

if ($sort == true){
	array_multisort($labels,$data);
}  

if ($type == 'line'){

	$g->set_data($data);
	$g->line_hollow( 2, 4, '#5E83BF', 'Documentos', 10 );

	$g->set_x_labels($labels);
	$g->set_x_label_style( 10, '0x000000', 0, 2 );

	$g->set_y_max( max($data) );
	$g->y_label_steps(4);

}else if ($type == 'pie'){

	$g->pie(60,'#505050','{font-size: 11px; color: #404040}');
	
	$g->pie_values( $data, $labels );
	$g->pie_slice_colours( array('#d01f3c','#356aa0','#C79810','#FFCC99','#009933','#FF99FF','#33FFFF','#CCCC99','#330033','#00CCFF','#CCCCCC','#FFCC00','#FF0033','#660000','#FFCCCC','#33FF33','#FF6633' ) );

}else{
开发者ID:robertatakenaka,项目名称:Biodiversidade,代码行数:30,代码来源:chart.php

示例4: date

  	$data_2[] = $row['vr_custo'];
  	$data_3[] = $row['vr_totalvenda']-$row['vr_custo'];
  	
  	$labels[] = date('d/m/Y',strtotime($row['data_venda']));

  	$max_value = ($max_value<$row['vr_totalvenda'])?$row['vr_totalvenda']:$max_value;
  	
}


$g = new graph();

$g->set_data( $data_1 );
$g->set_data( $data_2 );
$g->set_data( $data_3 );

$g->line_hollow( 3, 5, '0x9933CC', 'Venda', 10 );
$g->line_hollow( 3, 5, '0xCC3399', 'Custo', 10); 
$g->line_hollow( 3, 5, '0x80a033', 'Lucro', 10 );

$g->set_x_labels( $labels );
$g->set_x_label_style( 10, '0x000000', 0, 2 );

$g->set_y_max( $max_value );
$g->y_label_steps( 4 );
$g->set_y_legend( 'Valores em Real - R$', 12, '#000000' );
$g->bg_colour = '#FFFFFF';

echo $g->render();

?>
开发者ID:renatomarinho,项目名称:ASC,代码行数:31,代码来源:chart_clientes_vendidosperiodo.php

示例5: array

     //$data_avg[] = $report->info[$i]['avg'];
     $data_sum[] = number_format($report->info[$i]['sum'], 0, '', '');
 }
 $data_date = array();
 for ($i = 0; $i < $report->size; $i++) {
     $data_date[] = $report->info[$i]['text'];
 }
 // use the chart class to build the chart:
 include_once DIR_WS_CLASSES . 'ofc-library/open-flash-chart.php';
 $g = new graph();
 $g->bg_colour = '0xFFFFFF';
 $g->x_grid_colour = '0xd8d8d8';
 $g->y_grid_colour = '0xd8d8d8';
 $g->title(HEADING_TITLE . ': ' . $report_desc, '{font-size: 18px;}');
 $g->set_data($data_count);
 $g->line_hollow(3, 4, '0x0077cc', TEXT_NUMBER_OF_ORDERS, 12);
 $g->set_data($data_sum);
 $g->line_dot(3, 4, '0xff9900', TEXT_TOTAL_SUMM, 12);
 //
 // Attach the second data line (Free Ram) to the right axis:
 //
 $g->attach_to_y_right_axis(2);
 //
 // label each point with its value
 $g->set_x_labels($data_date);
 $g->set_x_label_style(10, '0x000000', 0, 2);
 // set the Y max
 $g->set_y_max(max($data_count) / 10 + max($data_count));
 $g->set_y_right_max(max($data_sum) / 10 + max($data_sum));
 // label every 20 (0,20,40,60)
 $g->y_label_steps(4);
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:31,代码来源:chart_data.php


注:本文中的graph::line_hollow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。