Home PHP Libraries Other libraries Relatively simple PHP chart library
Relatively simple PHP chart library
<?php
include "../libchart/classes/libchart.php";
$chart = new HorizontalBarChart(600, 170);
$dataSet = new XYDataSet();
$dataSet->addPoint(new Point("/wiki/Instant_messenger", 50));
$dataSet->addPoint(new Point("/wiki/Web_Browser", 75));
$dataSet->addPoint(new Point("/wiki/World_Wide_Web", 122));
$chart->setDataSet($dataSet);
$chart->getPlot()->setGraphPadding(new Padding(5, 30, 20, 140));
$chart->setTitle("Most visited pages for www.example.com");
$chart->render("generated/demo2.png");

//Special function to draw a 3-dimensional pie chart

//$data, pie chart structure data

//$data data parameters

//$ XPos, X coordinate of the center of the circle

//$YPos, Y coordinate of the center of the circle

//$Radius=100, radius

//$DrawLabels=PIE_NOLABEL, label style (Percentage and label)

//$EnhanceColors=false, border rendering

//$Skew=50, tilt angle

//$SpliceHeight=20, pie Thickness

//$SpliceDistance=5, distance between each plate

//$Decimals=2 Display percentage decimal places


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Chart library and its application in PHP Chart library and its application in PHP

23 Jun 2023

With the development of the Internet, data visualization has become an increasingly important skill. On websites or applications, data can be displayed more intuitively through charts, making it easier for users to understand. In PHP development, there are many chart libraries to choose from. This article will introduce some commonly used PHP chart libraries and their applications. GoogleChartsGoogleCharts is a free chart library provided by Google that supports multiple types of charts, such as line charts, bar charts, pie charts, etc. GoogleCharts by J

Detailed explanation of PHP chart generation function: chart generation guide for gd library, imagepng, imagestring and other functions Detailed explanation of PHP chart generation function: chart generation guide for gd library, imagepng, imagestring and other functions

18 Nov 2023

Detailed explanation of PHP chart generation functions: Chart generation guide for gd library, imagepng, imagestring and other functions. Chart generation plays an important role in data visualization and can present data change trends and relationships more intuitively. As a popular server-side scripting language, PHP provides a series of powerful chart generation functions. This article will introduce in detail the use of functions such as gd library, imagepng, imagestring, etc., and provide specific code examples to help readers quickly

Tips for generating simple graphical verification codes using PHP and GD library Tips for generating simple graphical verification codes using PHP and GD library

13 Jul 2023

Tips for generating simple graphical verification codes using PHP and GD libraries. With the development of the Internet, preventing malicious attacks and abuse has become an indispensable part of website development. CAPTCHA is a technical means widely used to verify user identity and prevent malicious robots from registering and logging in. As a popular server-side programming language, PHP, combined with the GD library, can quickly generate simple graphical verification codes. 1. Introduction to GD library The GD library is an extension library of PHP. It provides a series of functions and methods for processing images. Through the GD library,

PHP A relatively complete simple file upload_PHP tutorial PHP A relatively complete simple file upload_PHP tutorial

21 Jul 2016

PHP is a relatively complete simple file upload. Copy the code The code is as follows: HTML HEAD TITLE file upload/TITLE meta http-equiv="Content-Type" content="text/html; charset=gb2312"/HEAD BODY ? $UploadedFile=$_FILES['UploadedFile']['t

A relatively simple PHP paging grouping class_PHP tutorial A relatively simple PHP paging grouping class_PHP tutorial

21 Jul 2016

A relatively simple PHP paging grouping class. Copy the code as follows: ?php class mysqlPager{ var $pagePerNum=5;//Number of data items displayed on each page var $pagePerGroup=5;//Number of pages in each paging group var $curPage=0;//Current page, Defualt First

Relatively simple Baidu Netdisk file direct link PHP code_PHP tutorial Relatively simple Baidu Netdisk file direct link PHP code_PHP tutorial

21 Jul 2016

Relatively simple Baidu Netdisk file direct link PHP code. Baidu Netdisk is fast and stable. You deserve it. If direct connection is supported in the future, you can directly use Baidu Netdisk. What is provided here is a temporary solution and does not guarantee future

See all articles