A few days ago, I made a page at the company. To meet this requirement, I want to display the three columns of data in a data table in the database in line charts of three different colors,
Then, the data points are marked as vertices, and the coordinates of the data points are marked.
Let's take a look at the following ideas:
1. First, read the database and check the three columns of data in the data table and put them in three arrays;
2. Create a bitmap. All the images to be drawn are implemented using graphics;
3. Draw the X and Y axes Based on the screen coordinates, and then mark the scale;
4. Based on the X and Y axes, calculate the relative coordinates of each data on the screen and draw a line;
5. Draw a point on the data point and mark the data value;
6. Modify the image, and Mark text and other information.
After understanding the specific ideas, we can start to implement it. Create An ASPX page and setCodeIn an independent CS file. If the bitmap output position is not modified
The generated bitmap is output in Div by default. In addition, this bitmap can be output in the image control (set the SRC of the image control to this page ).
This article is an original file. For more information, see the source:Http://www.cnblogs.com/luzx/