c语言sscanf函数的用法是什么
264
2022-11-21
DEV--chartcontrol绘制统计图
1、条形图 界面放置一个dev的控件:chartcontrol,然后设置它的series,如果一个横坐标,比如说:任务ID,对应的三种状态:待验收、已验收、驳回。那么就有三个series,同时先设置好配色,选个漂亮的,对应其他窗体的颜色。剩下就是代码的完成了: Series s1 = this.chartControl1.Series[0]; s1.DataSource = dt; s1.ArgumentDataMember = ConstColumnName.COLUMN_XNAME; s1.ValueDataMembers[0] = ConstColumnName.COLUMN_STAYNAME; s1.LegendText = ConstColumnName.COLUMN_STAYNAME; Series s2 = this.chartControl1.Series[1]; s2.DataSource = dt; s2.ArgumentDataMember = ConstColumnName.COLUMN_XNAME; s2.ValueDataMembers[0] = ConstColumnName.COLUMN_ALREADYNAME; s2.LegendText = ConstColumnName.COLUMN_ALREADYNAME; Series s3 = this.chartControl1.Series[2]; s3.DataSource = dt; s3.ArgumentDataMember = ConstColumnName.COLUMN_XNAME; s3.ValueDataMembers[0] = ConstColumnName.COLUMN_REJECTNAME; s3.LegendText = ConstColumnName.COLUMN_REJECTNAME; ChartTitle _title = new ChartTitle(); _title.Text = "产品验收近一周统计"; chartControl1.Titles.Add(_title); public class ConstColumnName { //public const string SUM_COLUMN_NAME = "总任务数"; public const int SUM_COLUMN_NAME = 0; public const string IP_COLUMN_NAME = "日期"; public const string COLUMN_STAYNAME = "待验收"; public const string COLUMN_ALREADYNAME = "已验收"; public const string COLUMN_REJECTNAME = "驳回"; public const string COLUMN_XNAME = "日期"; //public const string COLUMN_YNAME = "产品数量"; public const int COLUMN_YNAME = 0; public const string PIE_STAYNAME = "待验收"; public const string PIE_ALREADYNAME = "已验收"; public const string PIE_REJECTNAME = "驳回"; //public const string PIE_YNAME = "数量"; public const int PIE_YNAME=0; public const string PIE_XNAME = "状态"; }最后显示图 (等到后面再补上) 2、扇形图 设置和条形图都差不多,所以直接上代码了: ChartTitle pChartTitle = new ChartTitle(); pChartTitle.Alignment = StringAlignment.Center; pChartTitle.Text = string.Format("产品验收统计({0})", toDate); chartControl2.Titles.Add(pChartTitle); if (flag == true) { Series Serices1 = new Series("饼状图", DevExpress.XtraCharts.ViewType.Pie3D); chartControl2.Series.Add(Serices1); //设置series样式 Serices1.ArgumentScaleType = ScaleType.Qualitative;//定性的 Serices1.ValueScaleType = ScaleType.Numerical;//数字类型 Serices1.PointOptions.PointView = PointView.ArgumentAndValues;//显示表示的信息和数据 Serices1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;//用百分比表示 Serices1.PointOptions.ValueNumericOptions.Precision = 2; Serices1.DataSource = PIEdt; Serices1.ArgumentDataMember = ConstColumnName.PIE_XNAME; Serices1.ValueDataMembers[0] = "Value"; } 最后显示图 (待补)
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~