php的gdchart引見

來源:互聯網
上載者:User
php的gdchart介紹

gdchart是PECL的一個類庫。也就是說它是一個C語言的擴充。雖然,目前PHP沒有預設安裝gdchart,但如果想使用,還是可以編譯的。

gdchart最大的好處不僅是效率高,速度快,同時,另外一點則是,使用極為方便。以下是一些執行個體說明。

?

線形圖:

add(array(2.5, 5.1, 8.6, 12.0, 15, 9, 8, 7));$chart->add(array(5.0, 8.0, 9.2, 10.2, 7, 8, 10, 9));$chart->add(array(8.0, 10.0, 14.0, 18.2, 16, 14, 12, 10));$chart->labels = array("Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug");$chart->colors = array(0x1133aa, 0xaa3311, 0x33aa11);$chart->out(640,480,IMG_PNG);?>

?

自訂座標線形圖

add(array(2.5, 5.1, 8.6, 12.0, 15, 9, 8, 7));$chart->add(array(5.0, 8.0, 9.2, 10.2, 7, 8, 10, 9));$chart->add(array(8.0, 10.0, 14.0, 18.2, 16, 14, 12, 10));$chart->labels = array("Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug");$chart->requested_ymin = 0;$chart->ylabel_density = 25;$chart->ylabel_fmt = "%.0f";$chart->colors = array(0x001133aa, 0x00aa3311, 0x33aa11);$chart->out(640,480,IMG_PNG);?>

?

3D地區圖

depth = 5;$chart->xtitle = "Fruits";$chart->xtitle_color = 0xffff00;$chart->bg_color = 0x112233;$chart->xlabel_color = 0xffffff;$chart->ylabel_color = 0xffffff;$chart->colors = array(0x30ffff00, 0x30ff00ff, 0x3000ffff);$chart->add(array(2.5, 5.1, 8.6, 12.0));$chart->add(array(5.0, 8.0, 9.2, 10.2));$chart->add(array(8.0, 10.0, 14.0, 18.2));$chart->labels = array("Apples","Oranges","Melons","Pears");$chart->out(640,480,IMG_PNG);?>

?

餅圖

title = "This is a Sample Pie Chart";$chart->title_font = "/usr/share/fonts/truetype/CANDY.ttf ";$chart->title_ptsize = 24;$chart->label_font = "/usr/share/fonts/truetype/Jester.ttf";$chart->label_ptsize = 16;$chart->edge_color = 0x000000;$chart->labels = array("red","green\r\n(exploded)","lt blue","purple","missing","cyan","blue");$chart->add(array(12.5, 20.1, 2.0, 22.0, 5.0, 18.0, 13.0));$chart->missing = array(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE);$chart->explode = array(0,40,0,0,0,0,0);$chart->pie_depth = 30;$chart->perspective = 0;$chart->pie_angle = 90;$chart->label_line = false;$chart->percent_labels = LABEL_ABOVE;$chart->out(640,480,IMG_PNG);?>

?3D高低位閉合圖

title = "High-Low-Close On top of an Area(volume) Graph";$chart->depth = 5.0;$chart->angle = 50;$chart->annotation_font_size = FONT_TINY;$chart->anno_note = "Earnings\nReport";$chart->anno_point = 8;$chart->vol_color = 0x40806040;$chart->grid = TICK_LABELS;$chart->ylabel_density = 40;$chart->hlc_style = HLC_CONNECTING | HLC_I_CAP | HLC_DIAMOND;$chart->add_scatter(17.0, 3, SCATTER_TRIANGLE_UP, 0x50808060, 30);$chart->add(array(17.8,17.1,17.3,17.2,17.1,17.3,17.3,17.3,17.1,17.5,17.4));$chart->add(array(16.4,16.0,15.7,15.25,16.0,16.1,16.8,16.5,16.8,16.2,16.0));$chart->add(array(17.0,16.8,16.9,15.9,16.8,17.2,16.8,17.0,16.9,16.4,16.1));$chart->add_combo(array(150.0,100.0,340.0,999.0,390.0,420.0,150.0,100.0,340.0,1590.0,700.0));$chart->labels =array("May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Jan","Feb","Mar","Apr");$chart->out(640,480,IMG_PNG);?>

?

?

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.