111,108
社区成员




C1.Win.C1Chart.Label lbl = C1WebChart1.ChartLabels.LabelsCollection.AddNewLabel();
lbl.Text = string.Format(" {0}% ", float.Parse(dv[i][" value "].ToString()));
lbl.Compass = LabelCompassEnum.Radial;
lbl.Offset = 20;
lbl.Connected = true;
lbl.Visible = true;
lbl.AttachMethod = AttachMethodEnum.DataIndex;
AttachMethodData am = lbl.AttachMethodData;
am.GroupIndex = 0;
am.SeriesIndex = i;
am.PointIndex = 0;
//.下载ComponentOne.Sutdio.Enterprise.2006.v1.for.dotNet1.1.zip(此版本针对.Net 1.1),解压,安装里面的ASP.NET控件安装包,找到安装目录,把BIN目录下的C1.Web.C1WebChart.dll和C1.win.C1Chart.dll拷贝到你项目的BIN目录下,并引用进项目
//加标签
C1.Win.C1Chart.Label lbl = C1WebChart1.ChartLabels.LabelsCollection.AddNewLabel();
//右侧相应项目标签的文本显示=取(dv表中i行名为Value的列的值)%100的百分数
lbl.Text = string.Format(" {0}% ", float.Parse(dv[i][" value "].ToString()));
lbl.Compass = LabelCompassEnum.Radial;
lbl.Offset = 20;
lbl.Connected = true;
lbl.Visible = true;
//AttachMethodData类被图表的Label对象和Label对象的Label.MethodData属性结合使用用于确定Label代替或者隶属于图表,AttachMethodData对象的每个属性仅仅意味着和Label.AttachMethod值相关
lbl.AttachMethod = AttachMethodEnum.DataIndex;
AttachMethodData am = lbl.AttachMethodData;
am.GroupIndex = 0;
am.SeriesIndex = i;
am.PointIndex = 0;