17

Graidle是一个能够生成各种统计分析图形的PHP项目。它可生成柱状图,饼状图,线状图等。
Graidle is a project that is proposed to realize a web application to generate graphical diagrams. There are several classes specialized in generating histograms(horizontal),line(filled) pie and spider charts.

网址:http://sourceforge.net/projects/graidle/

graidle example

使用:

<?php
    include_once("graidle.php");
    $g = new Graidle("收入增长图");
    $g->setValue(array(120,200,300,290,300,350,380,400,420), "b", "收入", "#CC0000");
    $g->setHeight(480);
    $g->setWidth(640);
    $g->setXtitle("月份");
    $g->setYtitle("收入(万元)");
    $g->setBgCl("#FFFFCC");
    $g->setFontCl("#3300FF");
    $g->setAxisCl("#000000");
    $g->setSecondaryAxis(1, 1);
    //$g->setXValue(array(2000,2001,2002,2003,2004,2005,2006,2007));
    //$g->setLegend(array(120,200,300,400,300,350,420,380,290));
    //$g->setExtLegend(2);
    $g->setDivision(50);
    $g->create();
    $g->carry();
?>

By 馒头 \\ tags: ,


3 Responses to “Graidle”

  1. 1. shengyang Says:

    您好!今天看了一下Graidle的应用,发现中文显示这上面有问题,请教如何解决?

  2. 2. 馒头 Says:

    to shengyang,你好。
    如果要显示中文的话,可能需要2个步骤:
    1、2个字体得能支持显示中文;
    2、将含有中文的php保存为UTF-8编码。
    请看附图。

  3. 3. xingxing Says:

    中文问题已经解决了,一个是需要保存为UTF-8,另外需要加载ttf文件,我用的是宋体。例子:$g->setFont(“./simsun.ttc”);
    $g->setFontBD(“./simsun.ttc”);
    $g->setFontLegend(“./simsun.ttc”);

Leave a Reply