PHP图表类 PHPlot

码农软件 · 软件分类 · 图形/图像处理 · 2019-09-09 20:59:33

软件介绍

PHPLOT 是一个用来创建图表的PHP图形类,需要 PHP5 的支持。PHPLot使用PHP的GD扩展来生成 PNG/GIF/JPEG 格式图片。

生成上面图形的代码如下:

# PHPlot Demo
# 2008-01-09 ljb
# For more information see http://sourceforge.net/projects/phplot/

# Load the PHPlot class library:
require_once 'phplot.php';

# Define the data array: Label, the 3 data sets.
# Year,  Features, Bugs, Happy Users:
$data = array(
  array(
'2001',  60,  35,  20),
  array(
'2002',  65,  30,  30),
  array(
'2003',  70,  25,  40),
  array(
'2004',  72,  20,  60),
  array(
'2005',  75,  15,  70),
  array(
'2006',  77,  10,  80),
  array(
'2007',  80,   5,  90),
);

# Create a PHPlot object which will make a 600x400 pixel image:
$p = new PHPlot(600400);

# Use TrueType fonts:
$p->SetDefaultTTFont('./arial.ttf');

# Set the main plot title:
$p->SetTitle('PHPlot Customer Satisfaction (estimated)');

# Select the data array representation and store the data:
$p->SetDataType('text-data');
$p->SetDataValues($data);

# Select the plot type - bar chart:
$p->SetPlotType('bars');

# Define the data range. PHPlot can do this automatically, but not as well.
$p->SetPlotAreaWorld(007100);

# Select an overall image background color and another color under the plot:
$p->SetBackgroundColor('#ffffcc');
$p->SetDrawPlotAreaBackground(True);
$p->SetPlotBgColor('#ffffff');

# Draw lines on all 4 sides of the plot:
$p->SetPlotBorderType('full');

# Set a 3 line legend, and position it in the upper left corner:
$p->SetLegend(array('Features''Bugs''Happy Users'));
$p->SetLegendWorld(0.195);

# Turn data labels on, and all ticks and tick labels off:
$p->SetXDataLabelPos('plotdown');
$p->SetXTickPos('none');
$p->SetXTickLabelPos('none');
$p->SetYTickPos('none');
$p->SetYTickLabelPos('none');

# Generate and output the graph now:
$p->DrawGraph();

本文地址:https://codercto.com/soft/d/14248.html

深入浅出WebAssembly

深入浅出WebAssembly

于航 / 电子工业出版社 / 2018-11 / 128.00元

WebAssembly是一种新的二进制格式,它可以方便地将C/C++等静态语言的代码快速地“运行”在浏览器中,这一特性为前端密集计算场景提供了无限可能。不仅如此,通过WebAssembly技术,我们还可以将基于Unity等游戏引擎开发的大型游戏快速地移植到Web端。WebAssembly技术现在已经被计划设计成W3C的标准,众多浏览器厂商已经提供了对其MVP版本标准的支持。在Google I/O ......一起来看看 《深入浅出WebAssembly》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具