Add one more mouth:
If you want to remove the button from the website, you can use HiddenField to store the Uri, which can be encrypted, or you can obtain the URL through this. Request. UrlReferrer. Note that the returned value of this. Request. UrlReferrer is URI type.
Directly run the Code:
Front-end page writing
1 <asp: Chart ID = "ChartPie" runat = "server" Width = "950px" BackColor = "# FFFFCC" Palette = "BrightPastel"
2 BorderWidth = "0" BorderColor = "# cc9900">
3 <Annotations> </Annotations>
4 <Legends>
5 <asp: Legend IsTextAutoFit = "False" Name = "Default" BackColor = "Transparent" Font = "Trebuchet MS, 8.25pt, style = Bold">
6 </asp: Legend>
7 </Legends>
8 <ChartAreas>
9 <asp: ChartArea Name = "ChartArea1">
10 </asp: ChartArea>
11 </ChartAreas>
12 </asp: Chart>
Background: The table structure is as follows:
Table structure required by the background
1 table = new DataTable ();
2 table. Columns. AddRange (new DataColumn [] {
3 new DataColumn ("url", typeof (String )),
4 new DataColumn ("liulan", typeof (Int32 )),
5 new DataColumn ("duli", typeof (Int32 )),
6 new DataColumn ("dacpno", typeof (Int32 ))
7 });
The Bind method is as follows:
Bind the background
1 Series seriesPies = new Series ("Domain Name Statistics ");
2 this. ChartPie. Series. Add (seriesPies );
3 this. ChartPie. ChartAreas [0]. Area3DStyle. Enable3D = true;
4 seriesPies. ChartType = SeriesChartType. Pie;
5 seriesPies. BorderWidth = 3;
6 seriesPies. ShadowOffset = 2;
7 Title tPie = new Title ("Statistical pie chart of interviewed domain names", Docking. Top, new Font (FontFamily. GenericSerif, 16, FontStyle. Bold), Color. Brown );
8 tPie. ShadowColor = Color. Gray;
9 tPie. ShadowOffset = 2;
10 this. ChartPie. Titles. Add (tPie );
11
12 for (int I = 0; I <this. table. Rows. Count; I ++)
13 {
14 object count = this. table. Rows [I] ["liulan"];
15 seriesPies. CustomProperties = "PieLabelStyle = Outside"; // connect the graphic area of the pie chart with the graphic text.
16 seriesPies. Points. AddXY (string. Concat (this. table. Rows [I] ["url"], "(", count, ")"), count );
17
From the world