How php uses Jpgraph to plot a simple X-Y coordinate chart

Source: Internet
Author: User
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.

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.