I have never touched on this before. The project needs to be quickly learned.
1. Let's take a rough look at the attributes.
2. Take a few examples to familiarize yourself with the process.
3. Be familiar with several binding methods.
When you do this, you can refer to the example (mschart has a project, which contains many examples). The main reason is its flexible use of attributes.
There are many binding methods. below is myCodeAnd chart image:
Datatable dt = New Datatable ();
DT = Dbmanager. dbhelper. executedataset (SQL );
Dataview dv = DT. defaultview;
// X axis name
Arraylist arraylistx = New Arraylist ();
Foreach (Datarow row In DT. Rows)
{
Arraylistx. Add (row [ 0 ]. Tostring () + " ( " + Row [ 1 ]. Tostring () + " ) " );
}
// Y axis name
Arraylist arraylisty = New Arraylist ();
Foreach (Datarow row In DT. Rows)
{
Arraylisty. Add (row [ 1 ]. Tostring ());
}
// Displays the Y value of each data point.
// Chart3.series ["Series1"]. isvalueshownaslabel = true;
Chart3.series [ " Series1 " ]. Points. databindxy (arraylistx, arraylisty );
// Actual chart type: seriescharttype. Pie. This is a pie chart.
Chart3.series [ " Series1 " ]. Charttype = Seriescharttype. Pie;
Chart3.series [ " Series1 " ] [ " Pielabelstyle " ] = " Disabled " ;