VML chart controls

Source: Internet
Author: User

A vml chart control that can be used to draw pie charts, bar charts, and line charts. Most of them are online materials. I just encapsulated them. Let's try them and give more valuable comments.
Download DLL


Just reference the DLL and add it to the toolbox.

Datatextfield: The column name of the data source. It is the description of each data item displayed at the bottom of the chart.
Reporttitle: Chart title
Charttype: Chart type (Columnchart, piechart, linechart), IfCSSet this attribute on the page and use EnumerationChart. net. webchart. charttypestyle

The position of the chart.TopAndLeftTo set

Processing on the CS page

Set chartDatasourceAttribute. The data source must beDataview
DatavaluefieldIsArraylistThe value is the name of the data source column. You can add names of multiple data items to be compared.
DatatypeIsArraylist, Which is mapped to the data item to be compared. It is the legend description of the data item.
After setting the preceding attributes, runDatabind ()Method

You only need to add one pie chartDatavaluefieldYou can.

Click Event
You can set click events for the control.ChartControlAutopostbackSet propertyTrue, And thenCSThe page adds a method for the Click Event of the Control. Its usage is similar to that of other. NetThe standard controls are the same.ChartclickeventargsYou can receive two values.,DatanameIndicates the data description of the clicked item.,DatavalueIs the value of the clicked item.

For example
Webchart webchart1 = new webchart ();
Webchart1.datasource = (dataview );


Webchart1.datavaluefield. Add ("field name 1 ");
Webchart1.datavaluefield. Add ("field name 2 ");

Webchart1.datatype. Add ("Chinese description of field name 1 ");
Webchart1.datatype. Add ("Description of field name 2 ");

Webchart1.databind ();

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.