一款漂亮的图表背景色

2010-09-23 21:47:53 作者:tony.lee 来源:本站原创 浏览次数:0

一款漂亮的图表背景色,给大家分享一下

属性:字符串bg_colour
$g->bg_colour = '#DFFFDF'; 
注:这是一个属性是一个字符串,十六进制颜色。

 

看到HTML示例使用的bg_colour进一步的例子。

 创建Flash对象
<?php
include_once 'php-ofc-library/open_flash_chart_object.php' ;
open_flash_chart_object ( 500 , 300 , 'http://' . $_SERVER [ 'SERVER_NAME' ] . '/open-flash-chart/data-26.php',false );
?>
data-26.php 
<?php

// generate some random data
srand ((double) microtime ()* 1000000 );

$data_1 = array();
$data_2 = array();
for(
$i = 0 ; $i < 9 ; $i ++ )
{
$data_1 [] = rand ( 21 , 25 );
$data_2 [] = rand ( 21 , 25 );
}

include_once(
'php-ofc-library/open-flash-chart.php' );
$g = new graph ();
$g -> title ( 'Gothic Department' , '{font-size: 25px; color: #FFB900}' );

$g -> bg_colour = '#303030' ;

$g -> set_data ( $data_1 );
$g -> bar ( 75 , '#FFB900' , 'Kittens' , 10 );

$g -> set_data ( $data_2 );
$g -> bar ( 75 , '#28A0DC' , 'Puppies' , 10 );

$g -> set_x_labels ( array( 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' ) );
$g -> set_x_label_style ( 14 , '#FFFFFF' , 2 );
$g -> set_x_legend ( 'Sacrifice breakdown (2007)' , 12 , '#FFFFFF' );

$g -> set_y_min ( 20 );
$g -> set_y_max ( 30 );

$g -> y_label_steps ( 2 );
$g -> set_y_label_style ( 14 , '#FFFFFF' );
$g -> set_y_legend ( 'Totals' , 12 , '#FFFFFF' );

$g -> x_axis_colour ( '#D0D0D0' , '#808080' );
$g -> y_axis_colour ( '#D0D0D0' , '#808080' );

echo
$g -> render ();
?>
关键词:图表背景色

相关文章

[收藏] [打印] [关闭] [返回顶部]

赞助商广告

更多

热门标签