In asp.net 2.0, you can easily see the chart using the OWC component of MS Office 2003 to display the graphic. In engineering, first add a reference to Microsoft Office Web Components 11.0, and then use MICROSOFT.OFFICE.INTEROP.OWC11;
1. Generate Column Chart
//Creates a value for the X coordinate, representing the month
int[] Month = new Int[3] {1, 2, 3};
//Creates a value for Y coordinates that represents sales
double[] Count = new Double[3] {120,240,220};
//Create chart Space
ChartSpace mychartspace = new ChartSpace ();
//Add a Chart object to the chart space
ChChart mychart = mychartSpace.Charts.Add (0);
//Set chart type, this example uses cylindrical
MyChart. Type = chartcharttypeenum.chcharttypecolumnclustered;
//Set some properties of the chart
//Do you need a legend
MyChart. HasLegend = true;
//Do you need a theme
MyChart. HasTitle = true;
//subject content
MyChart. Title.caption = "A quarterly summary";
//Set x,y coordinates
MyChart. Axes[0]. HasTitle = true;
MyChart. Axes[0]. Title.caption = "month";
MyChart. AXES[1]. HasTitle = true;
MyChart. AXES[1]. Title.caption = "Sales";
//Add three chart blocks
MyChart. SeriesCollection.Add (0);
MyChart. SeriesCollection.Add (0);
MyChart. SeriesCollection.Add (0);
//Set the properties of the chart block
//Title
MyChart. Seriescollection[0]. Caption = "January";
//x The value attribute of the coordinate
MyChart. Seriescollection[0]. SetData (Chartdimensionsenum.chdimcategories,
(int) chartspecialdatasourcesenum.chdataliteral, month[0]);
//y The value attribute of the coordinate
MyChart. Seriescollection[0]. SetData (Chartdimensionsenum.chdimvalues,
(int) chartspecialdatasourcesenum.chdataliteral, count[0]);
//Second block
MyChart. SERIESCOLLECTION[1]. Caption = "February";
//x The value attribute of the coordinate
MyChart. SERIESCOLLECTION[1]. SetData (Chartdimensionsenum.chdimcategories,
(int) Chartspecialdatasourcesenum.chdataliteral, month[1]);
//y The value attribute of the coordinate
MyChart. SERIESCOLLECTION[1]. SetData (Chartdimensionsenum.chdimvalues,
(int) chartspecialdatasourcesenum.chdataliteral, count[1]);
//Third block
MyChart. SERIESCOLLECTION[2]. Caption = "March";
//x The value attribute of the coordinate
MyChart. SERIESCOLLECTION[2]. SetData (Chartdimensionsenum.chdimcategories,
(int) chartspecialdatasourcesenum.chdataliteral, month[2]);
//y The value attribute of the coordinate
MyChart. SERIESCOLLECTION[2]. SetData (Chartdimensionsenum.chdimvalues,
(int) chartspecialdatasourcesenum.chdataliteral, count[2]);
//Generate picture
mychartspace.exportpicture (Server.MapPath (".") + @ "\test.jpg", "JPG", 500, 450);
//Load Picture
Image1.imageurl = Server.MapPath (".") + @ "\test.jpg";
}