<?php
class plchart {
var $chart;
var $data = array(
'title' => "title\ntest",
'group_count' => 4, //how many groups
'group_size' => 4, //size of each group
'group_desc' => array('1月份', '2月份', '3月份','333'), //describe text of each group, the size equal to group_count, other wise will be ingored or empty('')
'column_desc' => array('成交额', '销售额','不知道','我也不知道'), //describe text of each column in group, size same as group_size, other wise will be ingored or empty('')
'raw_data' => array(//size of raw_data is the same as group_size
array(34, 29, 55,33), //size of eache data is the same as group_count
array(45, 45, 61,44),
array(33,44,44,44),
array(33,44,44,44)
),
'legend_y' => '万元',
'legend_x' => '日期',
);
//image parameter
var $width = 1200;
var $height = 600;
var $quality = 100;
var $bgcolor;
var $savefile = '';
//image parameter end
//image header parameter (title & legend)
var $header_height = 70;
var $header_bgcolor;
var $title_top_margin = 10;
var $title_left_margin = 10;
//字体
var $title_font_color;
var $title_font_size;
var $title_font_style;
//legend paramenter
var $legend_height = 50;
var $legend_width = 100;
var $legend_bgcolor;
var $legend_color_array = array(); //legend colors ,size same as group_size
var $each_legend_h = 10;
var $each_legend_w = 20;
var $each_legend_gap = 5;
//字体
var $legend_font_color;
var $legend_font_size;
var $legend_font_style;
//chart paramenter
var $y_legend_font_color;
var $y_legend_font_size;
var $y_legend_font_style;
var $x_legend_font_color;
var $x_legend_font_size;
var $x_legend_font_style;
var $ruler_line_color;
var $chart_y_left = 10; //y轴头部留下
var $chart_x_left = 10; //x轴头部留下
var $chart_left_margin = 70; //用来写纵坐标的刻度
var $chart_right_margin = 10;
var $chart_bottom_margin = 50; //用来写横坐标的说明
var $chart_left_font_color;
var $chart_left_font_size;
var $chart_left_font_style;
var $chart_bottom_font_color;
var $chart_bottom_font_size;
var $chart_bottom_font_style;
var $chart_top_font_color;
var $chart_top_font_size;
var $chart_top_font_style;
function __construct($w=1200, $h=600) {
$this->width = $w;
$this->height = $h;
$this->ch
PHP 生成直方图的类(仿Light Chart)
最新推荐文章于 2024-07-08 09:16:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)