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 ();