using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using UAS_MES.CustomControl.DataGrid_View; using UAS_MES.DataOperate; using UAS_MES.PublicForm; using UAS_MES.PublicMethod; namespace UAS_MES { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("kernel32.dll")] public static extern bool d(int freq, int duration); private void button3_Click(object sender, EventArgs e) { d(800, 600); } private void Form1_Load(object sender, EventArgs e) { DataGridViewCheckBoxColumn checkboxCol = new DataGridViewCheckBoxColumn(); checkboxCol.Name = "全选"; //创建复选框列头单元格 DataGridViewCheckBoxHeaderCell ch = new DataGridViewCheckBoxHeaderCell(TestDGV, checkboxCol); //设置复选框那列的单元格为复选框 checkboxCol.HeaderCell = ch; this.TestDGV.Columns.Add(checkboxCol); blurSearch1.TableName = "Make"; blurSearch1.Field = "ma_code"; DataHelper dh = new DataHelper(); ViewChart((DataTable)dh.ExecuteSql("select nvl(ms_nextstepcode ,'已完工')ms_nextstepcode ,count(*) from makeserial left join makecraftdetail on ms_makecode=mcd_macode and ms_nextstepcode =mcd_nextstepcode where ms_makecode='MB17050022' group by ms_nextstepcode", "select"), "TExt"); } private void ViewChart(DataTable _dt, string _title) { List xData = new List(); List yData = new List(); for (int i = 0; i < _dt.Rows.Count; i++) { xData.Add(_dt.Rows[i]["ms_nextstepcode"].ToString()); yData.Add(int.Parse(_dt.Rows[i]["count(*)"].ToString())); } ct_coll.Series[0]["PieLineColor"] = "Red";//绘制黑色的连线。 this.ct_coll.Series[0].ToolTip = "#VAL{D}件";//鼠标移动到上面显示的文字 this.ct_coll.Series[0].BackSecondaryColor = Color.DarkCyan; this.ct_coll.Series[0].BorderColor = Color.DarkOliveGreen; this.ct_coll.Series[0].LabelBackColor = Color.Transparent; ct_coll.ChartAreas[0].Area3DStyle.Enable3D = true; ct_coll.Series[0].Points.DataBindXY(xData, yData); } } }