Home  >  Article  >  Backend Development  >  PHP uses Jpgraph to draw the basics of coordinate charts

PHP uses Jpgraph to draw the basics of coordinate charts

*文
*文Original
2017-12-28 11:26:421783browse

This article mainly introduces the method of using Jpgraph to draw simple X-Y coordinate diagrams in PHP, and analyzes the related techniques of Jpgraph to draw coordinate diagrams and curves with examples. I hope to be helpful.

The specific implementation method is as follows:


SetScale("textlin"); //设置刻度样式 
$graph->img->SetMargin(30,30,80,30); //设置图表边界 
$graph->title->Set("Year to Date Cost"); //设置图表标题 
// Create the linear plot 
$lineplot=new LinePlot($data); // 创建新的LinePlot对象 
$lineplot->SetLegend("Amount(M dollars)"); //设置图例文字 
$lineplot->SetColor("red"); // 设置曲线的颜色 
// Add the plot to the graph 
$graph->Add($lineplot); //在统计图上绘制曲线 
// Display the graph 
$graph->Stroke(); //输出图像 
?>


##The effect diagram after operation is as follows:

Related recommendations:

PHP graphics operation Jpgraph

php report jpgraph histogram example code

Jpgraph class library introductionntgraph graph download pyqtgrap

The above is the detailed content of PHP uses Jpgraph to draw the basics of coordinate charts. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn