using System; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Collections; using System.Collections.Specialized ;
Namespace Controls.custom {///
/// summary> [DefaultProperty), ToolboxData ("<{0}: chartpiereport runat = server> {0}: chartreport>")] public class chartpiereport: control {private int max; private string data; private string dataInfor; private string color; private string strPie; string [] tmpdata; pass numerical string // [] tmpdatainfor; // pass the corresponding content string [] tmpColor; string str_temp = ""; string strdivdatainfo = ""; Arraylist resultdata = new arraylist (); int = 2000; int colorinfotop = -2000; int DataInfotop = 10; double total = 0; #Region property [Bindable (True), Category ("Appearance"), DefaultValue "")] Public int max {get {return max;} set {max = value;}} [bindable (true), category ("data"), defaultValue ("")] public string data {get { Return Data;} set {data = value;}} [bindable (true), category ("data"), defaultValue ("")] public string datafor {get {return datainfor;} set {datainfor = value;}} Bindable (True), Category ("DATA"), DefaultValue ("")] public string color {get {return color;} set {color =
Value;}} #ndregion public chartpiereport () {strpie = " Total = Convert.TODOUBLE (TMPDATA [I]);} // Sprinkler Object Temp; for (int i = 0; i } For (int i = 0; i } Strdivdatainfo = " div>"; createpie (0, convert.todouble (Resultdata [0]), TMPCOLOR [0] .tostring (), TMPDATAINFOR [0] ": tmpdata [0] .tostring () ); Double currentValue = convert.todouble (ResultData [0]); for (int i = 1; i DataInfotop-10 i * 11; string ninfo = " }} #Endregion}} // Use example private void Page_load (Object sender, system.eventargs e) {chat1.max = 13; chat1.data = "12.5, 25, 19.5, 17.5, 12.5, 16, 9, 21, 3, 7, 8, 6.2, 9 "; chat1.datainfor =" Yangpu District, Zhabei District, Putuo District, Hongkou District, Baoshan District, Jiading District, Huangpu District, Minhang District, Pudong District, Jing'an, Xuhui District, other district , Other districts "; chat1.color =" red, # ffebcd, # fff55, # 00bff, # e6e6fa, # 7b68ee, # ffc33, #fc0cb, # 008b8b, # c27f34, # ffdead, # 00fa9a, # d3d3d3 ";} / / Ensure that the program is operating normally, please click here