This article mainly introduces the php using Jpgraph to draw a simple X-Y Coordinate graph method, the example analysis of the Jpgraph to draw the Coordinate graph and draw curve related skills, need friends can refer to below
This article mainly introduces the php using Jpgraph to draw a simple X-Y Coordinate graph method, the example analysis of the Jpgraph to draw the Coordinate graph and draw curve related skills, need friends can refer to below
This article describes how php uses Jpgraph to draw a simple X-Y coordinate chart. Share it with you for your reference. The specific implementation method is as follows:
<? Php include ("src/jpgraph. php "); include (" src/jpgraph_line.php "); // store the data to be used for chart creation in the array $ data = array, 90,96); $ graph = new Graph (400,300); // Create a new Graph object $ graph-> SetScale ("textlin "); // set the scale style $ graph-> img-> SetMargin (30, 30, 80, 30 ); // Set the chart boundary $ graph-> title-> Set ("Year to Date Cost "); // set the chart title // Create the linear plot $ lineplot = new LinePlot ($ data); // Create a new LinePlot object $ lineplot- > SetLegend ("Amount (M dollars)"); // set the legend text $ lineplot-> SetColor ("red "); // set the curve color // Add the plot to the graph $ graph-> Add ($ lineplot ); // draw a curve on the statistical graph // Display the graph $ graph-> Stroke (); // output the image?>
After running:
I hope this article will help you with php programming.
,