用户操作
[即时聊天] [发私信] [加为好友]
heiyelurenID:heiyeshuwu
892325次访问,排名39好友93人,关注者144
既然决定远行,便只顾风雨兼程。
heiyeshuwu的文章
原创 282 篇
翻译 3 篇
转载 209 篇
评论 517 篇
heiyeluren的公告

联系方式:


访问统计: free hit counter code
FeedSky订阅:
FeedSky订阅
最近评论
heiyeluren:注册发帖后才能下载。。。。不知道论坛咋设置。。。 :-)
kong:注册了也不能下载.....提示您的操作将会导致您的 金钱 低于系统规定的下限值 0
赵舜尧:感谢博主的分享,期待你的“下章接着讲述数据分割和散列方面的内容”
adobe cs4:呃,LAMP经典应用……
俺的
Adobe cs4也是
bluehouse1985:Linux 环境下的多核调试
— Intel + Totalview 强强联合!
目前,在软件开发行业,各种性能优异的调试工具层出不穷。但是,它们中的绝大部分都只支持windows环境。即使能支持linux平台,操作起来也很不方便。因此,对于长期在linux上编写程序的开发人员来说,如何调试就成了一个令人头痛的问题!Intel软件 和 Total……
文章分类
收藏
    相册
    技术图片
    搜索引擎
    ::eYou::
    kevin world
    lewis - 老吕
    qyb - BT的花
    Realzay的blog
    叶金荣
    天堂地狱鬼-dulao5's Blog
    沙漠之周
    狐狸糊涂
    老韩
    與子觀化
    ::Yahoo::
    glemir’s blog
    happy_fish - 分布式文件系统FastDFS
    LinZi's Blog
    Rainx
    stauren
    互联网,请记住我 - 162同学的技术博客
    冰的河
    小蚂蚁同学滴测试博客
    张彪同学
    随网之舞 - kaven的DHTML博客
    风雪之隅
    ::朋友::
    【推荐】中文分类网
    DDR的博客
    kevin world
    miky
    PHPCup.cn论坛
    俺兄弟的blog
    冰河的技术博客:心随风动
    好旅网
    小少的技术博客
    无尘居
    晋陵路人的Blog
    李天华同学滴技术博客
    沙狐部落
    轻量级的editor
    ::网友::
    blankyao同学
    Code & Stock.
    LionD8的Blog
    MooPHP - 轻量级PHP框架
    Phzzy
    张贺同学的博客
    技术大牛老余的博客
    抚琴居
    旋木木同学滴博客
    矛盾网
    程序人生
    邢红瑞的blog
    阿健的博客
    :PHP博客:
    .: Easy style :.
    [琴剑楼]
    CoolCode.cn
    Haohappy的Blog
    Hightman
    iwind的blog
    Javascript开发站
    JD Space
    Nio's Weblog
    Open Source PHP
    PHP面对对象
    SourceForge.net
    trip的专栏
    UGIA.cn
    windix's blog
    Windix's Weblog
    一个藏袍
    俊麟 Michael`s blog
    偶然的blog
    刘敏的blog
    大龄青年的Blog
    廖宇雷的blog
    懒猫开始新生活blog
    某人的栖息地
    王春生的博客
    神仙
    :牛人blog:
    DBA notes
    http://blog.csdn.net/tingya/
    侯捷网站
    孟岩
    搜索引擎研究
    方舟
    王咏刚的BLOG
    竹笋炒肉
    荣耀
    车东[Blog^2]
    透明思考
    陈硕的Blog
    DHTML
    DHTMLGoodies
    FCKEditor
    Google Code
    Google Web Toolkit
    HTML Goodies
    HTML.it
    HTMLAre
    HTMLdog
    JavaScript Kit
    jQuery
    KindEditor
    Prototype
    TinyMCE
    W3 Schools
    Yahoo JavaScript Developer Center
    Yahoo! Developer Network
    Yahoo! UI Library (YUI)
    网页设计师Web标准
    Java国内站
    ChinaJavaWorld.com技术论坛
    IBM developerWorks 中国: Java
    Java中文站
    Java开源大全
    Java爱好者
    JR - Java翻译站
    J道-JDON
    Matrix: 与Java共舞
    中国Java开发网
    中文java技术网
    PHP国内站点
    CSDN PHP论坛
    Discuz!
    FleaPHP
    Google--PHP用户组
    IBM DeveloperWorks
    JavsScript技术讨论
    Nirvana Studio
    OpenPHP.cn
    PHPChina
    TiM Club
    中文 PFC 1.0 手册--PHP5的开发包
    中文 PFC 1.0 手册--PHP5的开发包
    中文PHP网
    太平洋--PHP开发区
    爱MySQL
    超越PHP
    PHP国外站点
    ADOdb
    Agavi Framework
    Cake PHP
    MySQL Performance Blog
    MySQL Performance Blog
    Nonaweb
    PEAR
    PECL
    PECL Windows
    PHP Builder
    PHP Classes
    PHP Classes
    PHP New Download
    PHP Security Consortium
    php.MVC
    php.MVC
    PHPkitchen(OO & MVC)
    phpPatterns
    PHP国外图书下载
    smart template
    Smarty
    SourceForge.net
    Symfony Framework
    Zend
    Zend Framework
    Unix C/C++
    Free Gentux
    周立发的blog(Linux C)
    Unix/Linux
    BSD智库
    ChinaUnix
    FreeBSDChina
    FreeLAMP
    IBM开发者Linux专区
    Linux Byte
    LinuxKit
    LinuxTS
    Linux伊甸园
    Linux技术中坚站
    Linux非常空间
    Love Unix
    NetBSD&OpenBSD中文用户组
    NetBSD中国社区
    Oracle中国用户讨论组
    OurLinux
    Unix中文
    Unix中文
    Unix中文宝库
    中国Linux公社
    中国Unix用户技术论坛
    中文FreeBSD用户组
    永远的Unix
    炎黄角马
    程序设计
    CSDN
    IBM开发者中心
    Microsoft TechNet: 主页
    MSDN 中文网站
    PHP中文站
    Sun技术社区
    中国IT认证实验室--企业应用技术
    中国协议分析网
    喜悦国际村
    太平洋电脑网---开发特区
    实用网站
    veBook(国外大量免费图书下载网站)
    Whois.net
    中国Web信息博物馆
    中国互联网络信息中心whois查询
    服务器系统信息查看
    网络安全
    AnySide.com
    CGI Secutiry
    K-OTik Security Monitoring
    Linux Security
    Packet Storm Security
    PHP Secure
    RFC中文文档索引
    Safemode.org
    SecuriTeam.com
    Security Corporation
    SecurityFocus
    SecurityTracker
    Zone-h (区域黑客,每天公布各国被黑的网站)
    中华安全网
    中国信息安全组织
    国家计算机网络应急处理中心
    安全天使
    安全焦点
    幻影旅团
    绿盟科技
    网络安全评估中心(cnns )
    在线手册
    Apache2.0中文文档
    Beyond Linux From Scratch
    Debian参考手册
    FreeBSD Porter 手册
    FreeBSD使用手册
    Linux C函数中文参考手册
    MySQL 4.1.0 中文参考手册
    NetBSD在线手册
    OpenBSD在线FAQ
    PHP ADODB 1.99版手册中文翻译(Tripc)
    PHP中文手册(国内)
    PHP中文手册(国外)
    PostgreSQL中文文档
    Red Hat Linux 9入门指南
    Red Hat Linux 9安装指南
    Red Hat Linux 9定制手册
    中国OSS技术手册中心
    技术文档手册中心-ChinaUnix
    存档
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    转载 [转]JpGraph简介 --功能超级强大的PHP画图库收藏

    新一篇: [转]libhash中的哈希函数 | 旧一篇: [转]为 PHP 应用提速、提速、再提速!,第 3 部分: 用 Memcache 守护程序把数据缓存到内存中


    来源:http://listdo.bokee.com/viewdiary.12328652.html

    一、  么是JpGraph
    以前用PHP作图时必须要掌握复杂抽象的画图函数,或者借助一些网上下载的花柱形图、饼形图的类来实现。没有一个统一的chart类来实现图表的快速开发。

    现在我们有了一个新的选择:JpGraph。专门提供图表的类库。它使得作图变成了一件非常简单的事情,你只需从数据库中取出相关数据,定义标题,图表类型,然后的事情就交给JpGraph,只需掌握为数不多的JpGraph内置函数(可以参照JpGraph附带例子学习),就可以画出非常炫目的图表!

    一、  JpGraph安装方法:
    1、先到http://www.aditus.nu/jpgraph/下载最新的版本。
    2、确保你的PHP版本最低为4.04(最好是4.1.1),并且支持GD库。必须确保GD库可以正常运行,可以通过运行phpinfo()来查看GD库的信息是否存在的方法来判断。同时要有要求GD库的版本应为2.0,而不是1.0。
    3、将下载的JpGraph压缩包解压到任意文件夹。
    4、设置jpgraph.php(jpgraph的主配置文件)。设置jpgraph的cache(缓存)文件夹,和TTF(字体)文件夹。
    分别在35行和38行
    35  //  DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
    38  //  DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
    Linux系统改为:
    DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");'
    DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
    Windows系统改为:
    DEFINE("CACHE_DIR","c:/apache/htdocs/  jpgraph_cache/");'
    DEFINE("TTF_DIR","c:/windows/fonts");
    注意事项:
    (1)cache(缓存)文件夹路径可以自己定义,而TTF(字体)文件夹必须是%system%/Fonts。
    (2)确保PHP对cache(缓存)文件夹有写的权限。
    5、完成上述设置后就可以使用JpGraph了,可以先将JpGraph的例子copy到htdocs文件夹中,运行一下看看。呵呵,200多个例子,包含各类图表,够学一阵子的。

    在实际使用中,笔者还遇到了一些问题,比如字体错误等等,还在研究中……

    从数据库中读取数据到jpgraph图表中        
      1、将./src/Examples目录中的文件example16.2.php以及./src目录中的文件jpgraph_bar.php、jpgraph_gradient.php、jpgraph_line.php、jpgraph_plotmark.inc、jpgraph.php拷贝到同一目录下。
    2、建立数据库jpg,数据库表test
    建立2个字段:
    id(主键):int
    number:int
    并添加一些数据
    3、修改example16.2.php
    修改后的代码
    <?php
    include  ("jpgraph.php");
    include  ("jpgraph_line.php");
    include  ("jpgraph_bar.php");

    $connect=mysql_connect("localhost","root","");
    mysql_select_db("jpg",$connect);
    $query=mysql_query("select  *  from  test",$connect);
    $i=0;
    while  ($array=mysql_fetch_array($query))  {
    $l2datay[$i]=$array["number"];
    $i++;
    }
    mysql_close($connect);


    //  Create  the  graph.  
    $graph  =  new  Graph(400,200,"auto");  
    $graph->SetScale("textlin");

    $graph->img->SetMargin(40,130,20,40);
    $graph->SetShadow();


    //  Create  the  bar  plot
    $bplot  =  new  BarPlot($l2datay);
    $bplot->SetFillColor("orange");
    $bplot->SetLegend("Result");

    //  Add  the  plots  to  t'he  graph

    $graph->Add($bplot);


    $graph->title->Set("Adding  a  line  plot  to  a  bar  graph  v1");
    $graph->xaxis->title->Set("X-title");
    $graph->yaxis->title->Set("Y-title");

    $graph->title->SetFont(FF_FONT1,FS_BOLD);
    $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
    $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);

    //$graph->xaxis->SetTickLabels($datax);
    //$graph->xaxis->SetTextTickInterval(2);

    //  Display  the  graph
    $graph->Stroke();
    ?>
    4、刷新页面即可看到结果

     

     

    【附加信息】

    官方网站:http://www.aditus.nu/jpgraph/

    看看jpGraph能够达到的效果:
    来源:http://www.aditus.nu/jpgraph/features_gallery.php

     

    Line Plots

    Line plots can be easily adapted to almost any needs, it is possible to adjust colors, transparency levels, line weight, line type (solid, dotted, dashed etc), backgrounds, scale, axis positions and formatting.
     

     

     

    Filled Line Plots

    Line pots can also be filled both with a solid color, a semi transparent color or a gradient fill (both horizontal and vertical). The fill can also be one or several vertical band between two X-values.
     

     

     

    Step Line Plots

    A variant of plain line plot is the stepped line plot where each data point is connected by two 90 degrees link as is illustrated below.
     

     

     

    Line Plots With Markers

    Data values for line plots, scatter plots, radar plots etc. can be emphasized with either one of the multiple builtin markers (both plain and 3D) or if that is not enough it is also possible to use an arbitrary image as marker. When using an image as a marker it is also easy to set a specific scaling factor for the image to get a proper size without first having to manipulate the image in an external drawing program. The library will also cache any scaled image to reduce plot time and the need to do re-scaling for every data position.
     

     

     

    Line Plots With Inverted Y-axis

    As an example of usage of the scale formatting callback routines it is possible to further adjust the scaling in (almost) any way that is desired. In the example below we have used a small "trick" to invert the Y-axis to show a dive profile curve.

     

    Line Plots With Values

    It is of course possible to show the value of each data point for both line, bar, pie plots etc. No matter what type of plot is used the interface to the formatting of the values are identical, Formatting can be done either automatically, by specifying a formatting string (in the style of "printf">, or by using the more advanced method of specifying a callback formatting function that will be called upon for each data point to create the desired display value.

     

    Standard Bar plots

    Bar plots is also well catered for. Size of bars, fill colors, fill gradients, fill patterns etc are all configurable settings. It is also possible to use both accumulated, group or just plain bar graphs. For enhanced visual appearance it is also possible to use alpha blending and backgrounds. In the second image below a callback function for the formatting of the Y-axis values is used to format the label as a number with thousand separator.

     

     

    Horizontal Bar plots

    Horizontal bar graphs has also all the same formatting as standard vertical bars. In the example below we have also illustrated how it is possible to adjust the position of the value that can be displayed for each bar.

     

    Adding backgrounds and patterns to bar plots

    In the examples below we show two more formatting possibilities. The first example shows the addition of one of the pre-defined country flags as a background and the second example shows the addition of a background pattern between 2 Y-values.

     

    Combined Line and Bar plots

    As a final example of Bar plots we show some examples on how it is possible to combine bar and line plots. When adding a line plot to a bar graph it is possible to choose which point on the bar would correspond to the data point for the line (left, right or center position). In the examples below we have chosen to align the line with the center of the bars. In the last graph we have also added a vertical pattern to show how it is possible to emphasize a particular interval.
     

     

     

    Pie Plots

    For Pie plots all the ordinary formatting (colors, size etc) is of course available. In addition it is also possible to specify details such as, angle for first slice, the use of themes to automatically select a color set, position of pie, explode one or several slices. Pie plots also use Hare-Niemer integer compensation to make sure that all displayed values on slices always add up to 100%.

     

    3D Pie plots

    A variant of Pie plot is to display the Pie in a 3D perspective. This has all the formatting of the 2D pie but in addition it is possible to define the inclination of the Pie to adjust the perspective.
     

     

     

    Exploding Pie plots

    As a final example we show how to emphasize certain values by exploding one or several Pie slices. This formatting is available for both 2- and 3D Pie plots.
     

     

     

    Ring Plots

    A variant of the Pie plot is the ring plot. As can be expected this has all the formatting of the ordinary Pie but in addition it is possible to format a ring in the middle. The center ring can also display an arbitrary text and have a user specified color.
     

     

     

    Scatter plots

    Scatter plots is very similar to Line plots. They are used to display a number of data points that are defined by it's X- and Y-value. Each data point can be illustrated by one of the available plot-marks.

     

    Linked scatter plots

    A variant of the scatter plot is the linked scatter plot. By enable the links a line will be drawn that connects the data points in order. As usual color, weight and style of the lines can be adjusted. In the right graph we have also illustrated one of the pre-defined style of axis positioning/formatting.
     

     

     

    Combined Scatter and Line plots

    By combining a scatter plot with a line plot it is possible to for example illustrate linear regression.

     

    Impulse Plots

    Impulse plots is in a way similar to scatter and line plots. It is often used in signal processing to illustrate a sampled analogue signal which consists of a weighted pulse train. In the example below we show a typical damped impulse response.

     

    Field Plots

    Field plots is a scatter plot with a twist. By associating a callback function to plot it is possible to easily create images of various fields (e.g. for example magnetic, motion of air or fluids).

     

    Spline Curves

    The library also contains helper function to create smooth data from one or several control points, a.k.a spline plots. By default the library creates natural splines (2:nd derivate==0).

     

    Geographic Map Plots

    By combining a background image (that displays a map) with a scatter plot using plot-marks it is possible to create dynamic maps to illustrate various information. In the images below we have used the built-in "pushpin" plot-marks for a scatter plot.

     

     

    Stock Plots

    Another type of plots is the so-called Stock plots. The most common use of these graphs is to display values from the stock market. Each data point can display 4 values which are normally take as the open-close-high-low values of various stocks.
     

     

     

    Polar Plots (180 degrees)

    Polar plots is used to display a magnitude value in a specific direction. The polar plots have two variants; a full 360-degree plot and a half 180-degree plot. The magnitude can be displayed in either linear or logarithmic scale. Each polar graph can also have one or several plots.


     

     

     

    Polar Plots (360 degrees)

    Polar plots can also have plot-marks which are shown in the second example below. The formatting of the axis can also be adjusted for how the labels and tick marks are displayed. Some possible variants are also shown in the images below.

     

    Error plots

    Error plot is primarily used to display an error interval for each data point. Usually a line plots is combined with an error plot to show the errors for each data point.
     

     

     

    Balloon plots

    Balloon plot is basically a variant of the scatter plot where a call back function is used to give the "third dimension" of the plot, i.e. the size and color of each balloon.

     

    Radar Plots

    Radar plots are often used to visualize how a number of measurements compares with goals. The human capabilities of detecting unregular vs regular shapes makes this type of plot a very powerful way to illustrate progress for a number of parameters.
     

     

     

    Gantt Charts

    The Gantt chart is standard way to illustrate project plans or any activities that is layed out in time. The Gantt charts in JpGraph are extremely flexible and can easily be used to create very complex illustration of timed activities.
     

     

     

    Canvas plots

    This type is not really a standard plot. It gives a convenient way to create arbitrary shapes on a canvas. It will allow the usage of easily created scales and access to all the convenience methods and functions available in JpGraph.

     

     

    Spam challenge images

    This is used to create images of what is very hard to read letters and digits that can be used to prohibit automatic signup to mail-lists and online communities.

     

    Additional plots available in the Pro-Version

    More information about these types of plots are available in the information for the Pro-version of JpGraph. The additional graph types available are Windrose plots, Odometer plots and barcodes (both linear and 2-dimensional.)
     

     

    发表于 @ 2007年06月15日 18:16:00|评论(loading...)|收藏

    新一篇: [转]libhash中的哈希函数 | 旧一篇: [转]为 PHP 应用提速、提速、再提速!,第 3 部分: 用 Memcache 守护程序把数据缓存到内存中

    评论

    #Andreas 发表于2007-08-31 18:26:05  IP: 207.44.238.*
    interesting
    #Constantinos 发表于2007-08-31 20:21:38  IP: 83.239.57.*
    Interesting...
    #Kyriakos 发表于2007-08-31 23:31:38  IP: 66.232.123.*
    Interesting...
    #Nektarios 发表于2007-09-01 00:51:25  IP: 210.42.140.*
    Interesting...
    #Odysseas 发表于2007-09-01 16:37:51  IP: 66.232.125.*
    interesting
    #Anastassios 发表于2007-09-01 18:22:21  IP: 66.232.123.*
    Cool!
    #Pantelis 发表于2007-09-02 02:33:41  IP: 66.232.125.*
    Sorry :(
    #Athones 发表于2007-09-02 03:13:10  IP: 66.232.114.*
    Interesting...
    #Gustas 发表于2007-09-02 18:34:01  IP: 200.83.4.*
    Nice...
    #Andros 发表于2007-09-02 19:37:40  IP: 58.147.208.*
    Nice!
    #Markos 发表于2007-09-03 04:41:27  IP: 66.232.123.*
    Interesting...
    #Gondikas 发表于2007-09-03 10:20:14  IP: 190.7.62.*
    Nice...
    #Thanasios 发表于2007-09-03 12:20:24  IP: 66.232.114.*
    Cool!
    #Achilleas 发表于2007-09-03 13:36:22  IP: 66.232.123.*
    Nice...
    #Dion 发表于2007-09-03 18:19:56  IP: 66.232.125.*
    Nice!
    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © heiyeluren