ASP. NET line chart-(1) Train of Thought Analysis

Source: Internet
Author: User

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/

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.