How to insert table into chart in Asp.net for mixed display

Source: Internet
Author: User

Do not say anything. First, the first one to be implemented

Address: http://demos.telerik.com/aspnet-ajax/chart/examples/functionality/datatable/defaultcs.aspx

You need to reference the DLL to implement it!

However, in Microsoft's demo, the implementation is as follows:

In the first column of the table below, the color is displayed, and what I want is the name:

Code before modification:

E. chartgraphics. Graphics. fillrectangle (New solidbrush (Ser. Color ),
X-10, row * (axisfont. Height) + (point1.y), 10, axisfontsize. Height );
E. chartgraphics. Graphics. drawrectangle (new pen (bordercolor ),
X-10, row * (axisfont. Height) + (point1.y), 10, axisfontsize. Height );

Modified code:

// Set the name
Brush blackbrush = new solidbrush (color. White );
Rectanglef textarea = new rectanglef (X-80, row * (axisfont. Height) + (point1.y), 80, axisfontsize. Height );

// Set the table
E. chartgraphics. Graphics. drawrectangle (new pen (bordercolor), x-80, row * (axisfont. Height) + (point1.y ),
80, axisfontsize. Height );
E. chartgraphics. Graphics. drawstring (Ser. legendtext, new font ("", 12), new solidbrush (color. Black), textarea );

The implementation is as follows:

The results are not very satisfactory. After all, they are displayed. Another problem is that the interval between the image above and the table below is too wide, if a friend can change the chart demo to Figure 1 in the Microsoft chart demo, instruct him to modify chartdatatablehelper. CS. Thank you!

Related Article

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.