search
HomePHP LibrariesOther librariesPHP library for creating charts
PHP library for creating charts
<?php 
 include("pChart/pData.class");
 include("pChart/pChart.class");
 $DataSet = new pData;
 $DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4,-3,2,-3,3,5,1,0,7),"Serie1");
 $DataSet->AddPoint(array(0,3,-4,1,-2,2,1,0,-1,6,3,-4,1,-4,2,4,0,-1,6),"Serie2");
 $DataSet->AddAllSeries();
 $DataSet->SetAbsciseLabelSerie();
 $DataSet->SetSerieName("January","Serie1");
 $DataSet->SetSerieName("February","Serie2");
 $Test = new pChart(700,230);
 $Test->setFontProperties("Fonts/tahoma.ttf",8);
 $Test->setGraphArea(50,30,585,200);
 $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
 $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
 $Test->drawGraphArea(255,255,255,TRUE);
 $Test->draw

$graph->title->Set(iconv_arr("Phpwind Chart Test")); //Set the chart title here iconv_arr is added by myself. In order to support our great Chinese, you need to set your current encoding Convert to html entity

$graph->xaxis->title->Set(iconv_arr("This is probably the month")); //Set the X-axis title

$ graph->yaxis->title->Set(iconv_arr("This is the Y-axis")); //Set the Y-axis title

$graph->title->SetFont(FF_SIMSUN, FS_BOLD); //Set the title font. The default font here is FF_FONT1. For Chinese, change it to FF_SIMSUN

$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD); //Set X Axis title font

$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD); //Set Y-axis title font


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

Looking for a php/python library management program (similar to Baidu library, managing doc/pdf and other libraries)Looking for a php/python library management program (similar to Baidu library, managing doc/pdf and other libraries)

30Sep2016

Looking for a php/python library management program (similar to Baidu library, managing doc/pdf and other libraries)~~ It mainly needs to have search functions, especially file classification retrieval/file tag retrieval functions, no need for online conversion, online browsing!

RSGL | Modular header-only cross-platform GUI Library for easily creating GUI software your way!RSGL | Modular header-only cross-platform GUI Library for easily creating GUI software your way!

16Jul2024

RSGL is A modular simple-to-use cross-platform GUI library for easily creating GUI apps and games. It combines the freedom of lower-level GUI libraries with modern C techniques, offering both simplicity and convenience. Its main features are its buil

Practical methods for PHP function library project maintenancePractical methods for PHP function library project maintenance

15Jun2023

In development projects, the use of PHP function libraries is very extensive. With the continuous maintenance of the project, the maintenance and management of PHP function libraries have become more and more important. This article will introduce some practical methods of PHP function library maintenance to help project developers better manage and maintain function libraries. 1. Standardized naming Standardized naming of each function in the function library can make the function library easier to use and manage. When naming functions, try to use meaningful words and follow the following conventions: 1. Function names should use lowercase letters and the following

PHP client library recommendations and usage instructions for MQTT protocolPHP client library recommendations and usage instructions for MQTT protocol

09Jul2023

PHP client library recommendations and usage instructions for the MQTT protocol MQTT (MessageQueuingTelemetryTransport) is a lightweight message transmission protocol that is widely used in fields such as the Internet of Things and sensor networks. In PHP development, in order to facilitate communication with the MQTT server using the MQTT protocol, we can choose to use some PHP client libraries to simplify this process. In this article, we will recommend several commonly used PHP client libraries and provide usage instructions.

Tips for generating colorful verification code images using PHP and GD libraryTips for generating colorful verification code images using PHP and GD library

14Jul2023

Tips for generating colorful verification code images using PHP and GD libraries Introduction: Verification code is a common network security technology. By requiring users to enter a verification code when logging in, registering, or submitting a form, you can effectively prevent automated attacks from robots and malicious programs. This article will introduce the techniques of using PHP and GD libraries to generate colorful verification code images, helping developers to add a certain degree of recognizability and artistry when creating verification codes. 1. Environment preparation Before starting, make sure that PHP and GD libraries have been installed in your development environment. Can

Example code for dynamically generating line charts with PHP GD libraryExample code for dynamically generating line charts with PHP GD library

25Jul2016

Example code for dynamically generating line charts with PHP GD library

See all articles