| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Windows.Forms.DataVisualization.Charting;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinDataSource;
- namespace Core.StlMes.Client.BuyBillet
- {
- public partial class frmDDTJChart : FrmBase
- {
- private int angle = 0;
- private int angle1 = 0;
- private int colorsIndex = 0;
- private DataTable dtNew;
- //ctrl shift 键被按下
- private bool ctrlKeyDown;
- private bool shiftKeyDown;
- //自定义图颜色
- private Color[] chartColors;
- //当前活动 chart
- private Chart chartActive;
- public frmDDTJChart()
- {
- InitializeComponent();
- }
- private void Initial_ChartColors()
- {
- chartColors = new Color[] {
- Color.FromArgb(0,112,192), //蓝色 预留给作业时间
- Color.FromArgb(255,0,0), //橙红 预留给作业率
- Color.FromArgb(134,164,74),//橄榄色 预留给 停机时间
-
- Color.FromArgb(227,160,93),
- Color.FromArgb(178,90,126),
- Color.FromArgb(113,175,164),
- Color.FromArgb(3,54,73),
- Color.FromArgb(89,69,61),
- Color.FromArgb(1,77,103),
- Color.FromArgb(91,74,66),
- Color.FromArgb(90,13,67),
- Color.FromArgb(87,96,105),
- Color.FromArgb(147,224,255),
- Color.FromArgb(250,227,113),
- Color.FromArgb(107,194,53),
- Color.FromArgb(205,164,158),
- Color.FromArgb(23,44,60),
- Color.FromArgb(87,105,60),
- Color.FromArgb(28,120,135),
- Color.FromArgb(131,175,155),
- Color.FromArgb(192,0,0), //深红 预留给作业率
- Color.FromArgb(247,150,70),//橙色
- Color.FromArgb(165,151,185),//淡紫
- Color.FromArgb(206,142,141),//玫瑰红
- Color.FromArgb(142,165,203),//冰蓝
- Color.FromArgb(181,202,146),//浅绿
- Color.FromArgb(112,48,160),//紫色
- Color.FromArgb(61,150,174) //水绿色
- };
- }
- private void Hide_Dept()
- {
- foreach (var row in ucb1.DisplayLayout.Rows)
- {
- if (row.Cells["plinecode"].Value.ToString() == "-1")
- {
- row.Hidden = true;
- break;
- }
- }
- }
- private void frmDDTJChart_Load(object sender, EventArgs e)
- {
- initial_UltraDataSource1();
- this.ctrlKeyDown = false;
- this.shiftKeyDown = false;
- Initial_ChartColors();
- //chart 绑定鼠标滚轮缩放事件
- Chart1.MouseWheel += Chart_MouseWheel;
- Chart2.MouseWheel += Chart_MouseWheel;
- Chart3.MouseWheel += Chart_MouseWheel;
- //chart1、2、3 鼠标进入时事件注册
- Chart1.MouseEnter += Chart_MouseEnter;
- Chart2.MouseEnter += Chart_MouseEnter;
- Chart3.MouseEnter += Chart_MouseEnter;
- //this.KeyDown += frmDDTJChart_KeyDown;
- //this.KeyUp += frmDDTJChart_KeyUp;
- this.panel1.MouseWheel += panel1_MouseWheel;
- //Chart1、2、3 注册 键盘事件
- Chart1.KeyUp +=Chart_KeyUp;
- Chart1.KeyDown +=Chart_KeyDown;
- Chart2.KeyUp += Chart_KeyUp;
- Chart2.KeyDown += Chart_KeyDown;
- Chart3.KeyUp += Chart_KeyUp;
- Chart3.KeyDown += Chart_KeyDown;
- Hide_Dept();
- //隐藏图控件,当有数据时显示
- Chart_Hide_Show(false);
-
- this.startDate.Value = this.endDate.Value.AddMonths(-1);
- //ucb1.DisplayLayout.Bands[0].Columns["dept"].Width = 135;
- //ucb1.DisplayLayout.Bands[0].Columns["plinename1"].Width = 50;
- //ucb1.DisplayLayout.Bands[0].Columns["plinename2"].Width = 70;
- ucb1.DisplayLayout.Bands[0].Columns["dept"].Width = 200;
- ucb1.DisplayLayout.Bands[0].Columns["plinename1"].Width = 100;
- ucb1.DisplayLayout.Bands[0].Columns["plinename2"].Width = 100;
- ucb1.DisplayLayout.Bands[0].Columns["dept"].CellAppearance.TextHAlign = HAlign.Center;
- ucb1.DisplayLayout.Bands[0].Columns["plinename1"].CellAppearance.TextHAlign = HAlign.Center;
- ucb1.DisplayLayout.Bands[0].Columns["plinename2"].CellAppearance.TextHAlign = HAlign.Center;
- ucb1.DisplayLayout.Bands[0].Columns["dept"].CellAppearance.TextVAlign = VAlign.Middle;
- ucb1.DisplayLayout.Bands[0].Columns["plinename1"].CellAppearance.TextVAlign = VAlign.Middle;
- ucb1.DisplayLayout.Bands[0].Columns["plinename2"].CellAppearance.TextVAlign = VAlign.Middle;
- ucb1.DisplayLayout.Bands[0].Columns["dept"].CellAppearance.BackColor = Color.Wheat;
- ucb1.DisplayLayout.Bands[0].Columns["plinename1"].CellAppearance.BackColor = Color.YellowGreen;
- ucb1.DisplayLayout.Bands[0].Columns["plinename2"].CellAppearance.BackColor = Color.SkyBlue;
- ucb1.Width = 273;
-
- //以下设置图控件初始大小
- this.Chart1.Width = Convert.ToInt32(Math.Ceiling(this.Width * 0.8))>900?Convert.ToInt32(Math.Ceiling(this.Width * 0.8)):900;
- this.Chart2.Width = this.Width - this.Chart1.Width > 900 ? this.Width - this.Chart1.Width : 900;
- this.Chart3.Width = this.Chart2.Width-200;
- UltraGridBand band = this.ucb1.DisplayLayout.Bands[0];
- foreach (UltraGridRow row in band.GetRowEnumerator(GridRowType.DataRow))
- {
- if (row.Cells["dept"].Value.ToString().Contains("全部"))
- {
- row.Cells["dept"].Appearance.FontData.Bold = DefaultableBoolean.True;
- }
- if (row.Cells["plinename2"].Value.ToString().Contains("全部"))
- {
- row.Cells["plinename2"].Appearance.FontData.Bold = DefaultableBoolean.True;
- }
- }
- }
- void panel1_MouseWheel(object sender, MouseEventArgs e)
- {
- HandledMouseEventArgs h = e as HandledMouseEventArgs;
- if (h != null)
- {
- h.Handled = false;
- }
- }
- void frmDDTJChart_KeyUp(object sender, KeyEventArgs e)
- {
- this.ctrlKeyDown = e.Control;
- this.shiftKeyDown = e.Shift;
- }
- void frmDDTJChart_KeyDown(object sender, KeyEventArgs e)
- {
- this.ctrlKeyDown = e.Control;
- this.shiftKeyDown = e.Shift;
- }
- void Chart_MouseWheel(object sender, MouseEventArgs e)
- {
- //var chart = (Chart)sender;
- //var xAxis = chart.ChartAreas[0].AxisX;
- //var yAxis = chart.ChartAreas[0].AxisY;
- //try
- //{
- // if (e.Delta < 0) // Scrolled down.
- // {
- // //xAxis.ScaleView.ZoomReset();
- // //yAxis.ScaleView.ZoomReset();
- // Chart1.Width -= 20;
- // }
- // else if (e.Delta > 0) // Scrolled up.
- // {
- // //var xMin = xAxis.ScaleView.ViewMinimum;
- // //var xMax = xAxis.ScaleView.ViewMaximum;
- // //var yMin = yAxis.ScaleView.ViewMinimum;
- // //var yMax = yAxis.ScaleView.ViewMaximum;
- // //var posXStart = xAxis.PixelPositionToValue(e.Location.X) - (xMax - xMin) / 4;
- // //var posXFinish = xAxis.PixelPositionToValue(e.Location.X) + (xMax - xMin) / 4;
- // //var posYStart = yAxis.PixelPositionToValue(e.Location.Y) - (yMax - yMin) / 4;
- // //var posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + (yMax - yMin) / 4;
- // //xAxis.ScaleView.Zoom(posXStart, posXFinish);
- // //yAxis.ScaleView.Zoom(posYStart, posYFinish);
- // Chart1.Width += 20;
- // }
- //}
- //catch { }
- Chart chart = sender as Chart;
- HandledMouseEventArgs h = e as HandledMouseEventArgs;
- if (h != null)
- {
- h.Handled = true;
- }
- bool IsGoUp = e.Delta > 0 ? true : false;
- if (this.ctrlKeyDown)
- {
- if (chart != null)
- {
- if (IsGoUp)
- {
- chartActive.Width += 20;
- }
- if (!IsGoUp)
- {
- chartActive.Width -= 20;
- }
- }
- }
- else if (this.shiftKeyDown)
- {
- //int hStep = (int)(this.pictureBox2.Image.Width * 0.02);
- //int vStep = (int)(this.pictureBox2.Image.Height * 0.02);
- if (IsGoUp)
- {
- //this.pictureBox2.Width += hStep;
- //this.pictureBox2.Height += vStep;
- }
- else
- {
- //this.pictureBox2.Width -= hStep;
- //this.pictureBox2.Height -= vStep;
- }
- }
- else
- {
- //if (IsGoUp && this.panel1.VerticalScroll.Value > 5)
- //{
- // this.panel1.VerticalScroll.Value -= 5;
- //}
- //if (!IsGoUp && this.panel1.VerticalScroll.Value < this.panel1.VerticalScroll.Maximum - 5)
- //{
- // this.panel1.VerticalScroll.Value += 5;
- //}
- }
- }
- //显示或隐藏图控件
- private void Chart_Hide_Show(bool flag)
- {
- if (flag)
- {
- this.Chart1.Show();
- this.Chart2.Show();
- this.Chart3.Show();
- }
- else
- {
- this.Chart1.Hide();
- this.Chart2.Hide();
- this.Chart3.Hide();
- }
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void Query()
- {
- string plinecode = ucb1.Value==null?string.Empty:ucb1.Value.ToString();
- if(string.IsNullOrEmpty(plinecode)){
- MessageUtil.ShowTips("请选择机组产线!");
- return;
- }
- int flag = DateTime.Compare(this.startDate.Value, this.endDate.Value);
- string startDate = this.startDate.Value.ToString("yyyyMMdd");
- string endDate = this.endDate.Value.ToString("yyyyMMdd");
- if (Convert.ToInt32(startDate) > Convert.ToInt32(endDate))
- {
- MessageUtil.ShowWarning("起始日期不能大于截止日期!");
- return;
- }
- int days = DateDiff(this.startDate.Value.AddDays(-1), this.endDate.Value);
- startDate = this.startDate.Value.AddDays(-1).ToString("yyyyMMdd");
-
- DataTable dt = ServerHelper.GetData("com.steering.pss.buybillet.Buybillet.get_FrmddTJChart_data", new object[] { startDate, endDate, days.ToString(), plinecode }, this.ob);
- //dt.Columns["optime"].DataType = Type.GetType("System.Decimal");
- dtNew = dt.Clone(); //复制baidt表数据结构
- dtNew.Columns["optime"].DataType = Type.GetType("System.Decimal");
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- dtNew.Rows.Add(dt.Rows[i].ItemArray); //添加数du据行
- }
- if (dtNew != null && dtNew.Rows.Count > 0)
- {
- Build_Chart(dtNew);
- Build_ChartPie1(dtNew);
- Build_ChartPie2(dtNew);
- Chart_Hide_Show(true);
- index = 0;
- colorsIndex = 3;
- timer1.Enabled = false;
-
- //Chart1.Width = 1000;
- //Chart1.Width = 800;
- }
- else
- {
- MessageUtil.ShowTips("未查询到相关数据!");
- }
-
- }
- private void Chart_Initial(Chart chart)
- {
- if (chart.Series.Count > 0)
- {
- chart.Series.Clear();
- }
- if (chart.Titles.Count > 0)
- {
- chart.Titles.Clear();
- }
- //以下是图例属性的设置
- chart.Legends[0].Enabled = true; //是否显示图例
- //Chart1.Legends[0].Position.Auto = true;
- chart.Legends[0].Docking = Docking.Bottom; //Docking是图例的停靠位置
- chart.Legends[0].Alignment = StringAlignment.Center;//Alignment属性是图例的对齐方式
- //设置控件背景、图区域、图例的背景色为透明 同产销Form一致
- chart.BackColor = Color.Transparent;
- chart.ChartAreas[0].BackColor = Color.Transparent;
- chart.Legends[0].BackColor = Color.Transparent;
- //if (chart.Name == "Chart1")
- //{
- // chart.Width = 800;
- //}
- //if (chart.Name == "Chart2")
- //{
- // chart.Width = 600;
- //}
- }
-
- //以下代码生成左侧柱状曲线图
- private void Build_Chart(DataTable dt)
- {
- //初始化图控件,设置公共属性
- Chart_Initial(Chart1);
- //if (Chart1.Series.Count > 0)
- //{
- // Chart1.Series.Clear();
- //}
- //if (Chart1.Titles.Count > 0)
- //{
- // Chart1.Titles.Clear();
- //}
- //Get the DISTINCT Countries.
- List<string> depts = (from p in dt.AsEnumerable()
- select p.Field<string>("dept")).Distinct().ToList();
- //Remove the Default Series.
- //if (Chart1.Series.Count() == 1)
- //{
- // Chart1.Series.Remove(Chart1.Series[0]);
- //}
- //Loop through the Countries.
- foreach (string dept in depts)
- {
- //Get the Year for each Country.
- DateTime[] x = (from p in dt.AsEnumerable()
- where p.Field<string>("dept") == dept
- orderby p.Field<DateTime>("opdate") ascending
- select p.Field<DateTime>("opdate")).ToArray();
- //Get the Total of Orders for each Country.
- decimal[] y = (from p in dt.AsEnumerable()
- where p.Field<string>("dept") == dept
- orderby p.Field<DateTime>("opdate") ascending
- select p.Field<decimal>("optime")).ToArray();
- //Add Series to the Chart.
- Chart1.Series.Add(new Series(dept));
- Chart1.Series[dept].IsValueShownAsLabel = true;
- Chart1.Series[dept].ChartType = SeriesChartType.StackedColumn;
- Chart1.Series[dept].Points.DataBindXY(x, y);
- for (int i = 0; i < y.Length; i++)
- {
- if (y[i] == 0)
- {
- Chart1.Series[dept].Points[i].IsValueShownAsLabel = false;
- }
- Chart1.Series[dept].Points[i].IsValueShownAsLabel = false;
- }
- }
- foreach (string dept in depts)
- {
- if (dept != "作业时间")
- continue;
- //Get the Year for each Country.
- DateTime[] x = (from p in dt.AsEnumerable()
- where p.Field<string>("dept") == dept
- orderby p.Field<DateTime>("opdate") ascending
- select p.Field<DateTime>("opdate")).ToArray();
- //Get the Total of Orders for each Country.
- decimal[] y = (from p in dt.AsEnumerable()
- where p.Field<string>("dept") == dept
- orderby p.Field<DateTime>("opdate") ascending
- select p.Field<decimal>("optime")).ToArray();
- //Add Series to the Chart.
- string str = "作业率";
- Chart1.Series.Add(new Series(str));
- Chart1.Series[str].IsValueShownAsLabel = true;
- Chart1.Series[str].ChartType = SeriesChartType.Line;
- Chart1.Series[str].Points.DataBindXY(x, y);
- for (int i = 0; i < y.Length; i++)
- {
- Chart1.Series[str].Points[i].IsValueShownAsLabel = false;
- //Chart1.Series[str].Points[i].Color = chartColors[1];
- }
- }
- Chart1.Series[0].YAxisType = AxisType.Primary;
- //Chart1.Series[5].YAxisType = AxisType.Secondary;
- Chart1.Series["作业率"].MarkerStyle = MarkerStyle.Circle;
- Chart1.Series["作业率"].Color = Color.Red;
- Chart1.Series["作业率"].MarkerSize = 9;
- Chart1.Series["作业率"].MarkerBorderWidth = 9;
- Chart1.Series["作业率"].BorderWidth = 3;
- Chart1.Series["作业率"].IsValueShownAsLabel = false;
- //Chart1.Series["作业率"].SetCustomProperty("LineTension", "0.05");
- //foreach (string country in countries)
- //{
- // if (country != "Brazil")
- // continue;
- // //Get the Year for each Country.
- // int[] x = (from p in dt.AsEnumerable()
- // where p.Field<string>("ShipCountry") == country
- // orderby p.Field<int>("Year") ascending
- // select p.Field<int>("Year")).ToArray();
- // //Get the Total of Orders for each Country.
- // //int[] y = (from p in dt.AsEnumerable()
- // // where p.Field<string>("ShipCountry") == country
- // // orderby p.Field<int>("Year") ascending
- // // select p.Field<int>("Total")).ToArray();
- // double[] y = new double[] { 0.25, 0.45, 0.79 };
- // //Add Series to the Chart.
- // string str = country + "test";
- // Chart1.Series.Add(new Series(str));
- // //Chart1.Series[str].IsValueShownAsLabel = true;
- // Chart1.Series[str].ChartType = SeriesChartType.Line;
- // Chart1.Series[str].Points.DataBindXY(x, y);
- //}
- Chart1.Series[0].YAxisType = AxisType.Primary;
- //Chart1.Series[3].YAxisType = AxisType.Secondary;
- //Chart1.Series[3].MarkerStyle = MarkerStyle.Diamond;
- //Chart1.Series[3].MarkerSize = 35;
- //Chart1.Series[3].MarkerBorderWidth = 35;
- //Chart1.ChartAreas[0].AxisY2.LineColor = System.Color.Transparent;
- //Chart1.ChartAreas[0].AxisY2.MajorGrid.Enabled = false;
- //Chart1.ChartAreas[0].AxisY2.Enabled = AxisEnabled.True;
- //Chart1.ChartAreas[0].AxisY2.IsStartedFromZero = Chart1.ChartAreas[0].AxisY.IsStartedFromZero;
- //Chart1.ChartAreas[0].AxisY2.Minimum = 0;
- //Chart1.ChartAreas[0].AxisY2.Minimum = 1;
- ////Chart1.ChartAreas[0].AxisY2.Interval = 0.1;
- //Chart1.ChartAreas[0].AxisY2.LabelStyle.Format = "0%";
- //Chart1.Series[3].Label = "#VAL{P}";
- Chart1.ChartAreas[0].AxisY.MajorGrid.Enabled = false;//不显示网格线
- Chart1.ChartAreas[0].AxisY2.MajorGrid.Enabled = false;//不显示网格线
- Chart1.ChartAreas[0].AxisY2.Enabled = AxisEnabled.True;
- Chart1.ChartAreas[0].AxisY2.LabelStyle.Format = "0%";//格式化,为了显示百分号
- Chart1.ChartAreas[0].AxisY2.Interval = 0.1;//设置刻度间隔为5%
- Chart1.ChartAreas[0].AxisY2.Maximum = 1;
- //Chart1.Series[3].Label = "#VAL{P}";
- Chart1.ChartAreas[0].Area3DStyle.Enable3D = false;//设置3D效果
- //chart2.ChartAreas[0].Area3DStyle.PointDepth =
- Chart1.ChartAreas[0].Area3DStyle.PointGapDepth = 50;//设置一下深度,看起来舒服点……
- Chart1.ChartAreas[0].Area3DStyle.WallWidth = 0;//设置墙的宽度为0;
- ////以下是图例属性的设置
- //Chart1.Legends[0].Enabled = true; //是否显示图例
- ////Chart1.Legends[0].Position.Auto = true;
- //Chart1.Legends[0].Docking = Docking.Bottom; //Docking是图例的停靠位置
- //Chart1.Legends[0].Alignment = StringAlignment.Center;//Alignment属性是图例的对齐方式
- //Chart1.Series[0]["PointWidth"] = "1";
- //Chart1.Series[1]["PointWidth"] = "1";
- //Chart1.Series[2]["PointWidth"] = "1";
- //Chart1.Series[3]["PointWidth"] = "1";
- //Chart1.Series[4]["PointWidth"] = "1";
- //Chart1.Series[0].Label = "#PERCENT -- #VALY";
- Chart1.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.None; //设置当前X轴Label自动设置格式=关闭
- Chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;//设置当前X轴Label的显示间隔周期=1 (1个项目) (=2的意思: 间隔2个项目显示...以此类推)
- Chart1.ChartAreas[0].AxisX.LabelStyle.IsStaggered = false;//设置当前X轴Label的双行显示格式= 打开. (双行显示的效果如下图)
- Chart1.ChartAreas[0].AxisX.LabelStyle.Angle = -60;//x轴倾斜的角度。
- Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Format = "MM-dd";//x轴Label 格式化。
- Chart1.ChartAreas[0].AxisY.Maximum = 24;
- Chart1.ChartAreas[0].AxisY.Interval = 3;//设置刻度间隔为3
- Chart1.ChartAreas[0].BackColor = Color.Transparent;
- Chart1.Legends[0].BackColor = Color.Transparent;
- //Chart1.ChartAreas[0].AxisY.Title = "生产厂停机";
- //Chart1.ChartAreas[0].AxisY.TitleFont = new Font("Arial Unicode MS", float.Parse("10"),FontStyle.Regular);
- //Chart1.ChartAreas[0].AxisY.TitleForeColor = Color.FromName("Black");
- //Chart1.ChartAreas[0].AxisY.Title = "简体中文";
- //Chart1.ChartAreas[0].AxisY.IsLabelAutoFit = true;
- //Chart1.ChartAreas[0].AxisY2.IsLabelAutoFit = true;
- //以下设置Chart四周空白面积
- Chart1.ChartAreas[0].Position.X = 0;
- Chart1.ChartAreas[0].Position.Width = 100;
- Chart1.ChartAreas[0].Position.Height = 75;
- Chart1.ChartAreas[0].Position.Y = 6;
- //Chart1.ChartAreas[0].AxisX.IsMarginVisible = true;
- //Chart1.ChartAreas[0].AxisX.IntervalOffset = 1;
- //Chart1.ChartAreas[0].AxisX.Minimum = Double.NaN;
- //Chart1.ChartAreas[0].AxisX.Maximum = Double.NaN;
- //Chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
- //Chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
- //Chart1.ChartAreas[0].AxisY.IsMarginVisible = false;
- //Chart1.ChartAreas[0].AxisY2.IsMarginVisible = false;
- //Chart1.ChartAreas[0].InnerPlotPosition.Y = 100;
- //Chart1.ChartAreas[0].AxisX.LabelStyle.IntervalOffset = -1;
- //Chart1.ChartAreas[0].AxisX.MajorGrid.IntervalOffset = 0.5;
- //Chart1.ChartAreas[0].AxisX.MajorTickMark.IntervalOffset = 0.5;
- string deptName = ucb1.Text;
- this.Chart1.Titles.Add(new Title(deptName + "运行停机图", Docking.Top, new Font("Arial Unicode MS", float.Parse("15"), FontStyle.Regular), Color.FromName("Black")));
- //设置柱状图宽度
- foreach (var series in Chart1.Series)
- {
- series["PixelPointWidth"] = "10";
- //Chart1.Series[0]["PixelPointWidth"] = "15";
- }
- //设置chart 颜色
- //for (int i = 0; i < Chart1.Series[0].Points.Count; i++)
- //{
- // DataPoint p = Chart1.Series[0].Points[i];
- // if (p.AxisLabel == "作业时间")
- // {
- // p.Color = chartColors[0];
- // continue;
- // }
- // if (colorsIndex > chartColors.Length - 1)
- // {
- // break;
- // }
- // else
- // {
- // p.Color = chartColors[colorsIndex++];
- // }
- //}
- //设置chart column 颜色
- //for (int i = 0; i < Chart1.Series.Count; i++)
- //{
- // if (Chart1.Series[i].Name == "作业时间")
- // {
- // //foreach (DataPoint p in Chart1.Series[i].Points)
- // //{
- // // p.Color = chartColors[0];
-
-
- // //}
- // Chart1.Series[i].Color = chartColors[0];
-
- // }
- // else if (Chart1.Series[i].Name == "作业率")
- // {
- // //foreach (DataPoint p in Chart1.Series[i].Points)
- // //{
- // // p.Color = chartColors[0];
- // //}
- // Chart1.Series[i].Color = chartColors[1];
- // }
- // else
- // {
- // if (colorsIndex > chartColors.Length - 1)
- // {
- // break;
- // }
- // else
- // {
- // //foreach (DataPoint p in Chart1.Series[i].Points)
- // //{
- // // p.Color = chartColors[colorsIndex];
- // //}
- // Chart1.Series[i].Color = chartColors[colorsIndex];
- // colorsIndex++;
- // }
- // }
- //}
-
- }
- //以下代码生成右侧饼图(Pie)
- private void Build_ChartPie(DataTable dt)
- {
- //初始化图控件,设置公共属性
- Chart_Initial(Chart2);
- var query = from r in dt.AsEnumerable()
- group r by r.Field<string>("DEPT")
- into s
- select new
- {
- DEPT = s.Select(m => m.Field<string>("DEPT")).First(),
- OPTIME = s.Sum(p => p.Field<decimal>("OPTIME"))
- };
- //Get the names of Cities.
- string[] x = query.Select(p => p.DEPT).ToArray();
- //Get the Total of Orders for each City.
- decimal[] y = query.Select(p => p.OPTIME).ToArray();
- Chart2.Series.Add(new Series());
- Chart2.Series[0].ChartType = SeriesChartType.Pie;
- Chart2.Series[0].Points.DataBindXY(x, y);
- //foreach (DataPoint p in Chart2.Series[0].Points)
- //{
- // p.Label = x[0] + " #PERCENT{P2}";
- //}
- //Chart2.Series[0]["PieLabelStyle"] = "Outside";
- //Chart2.Legends[0].Enabled = true;
- Chart2.Series[0]["PieLabelStyle"] = "Outside";
- for (int i=0;i< Chart2.Series[0].Points.Count;i++)
- {
- DataPoint p = Chart2.Series[0].Points[i];
- p.Label = x[i] + " #PERCENT{P2}";
- p.LegendText = x[i];
- }
- Chart2.ChartAreas[0].Area3DStyle.Enable3D = true;
- string deptName = ucb1.Text;
- Chart2.Titles.Add(new Title(deptName + "运行停机比", Docking.Top, new Font("Arial Unicode MS", float.Parse("15"), FontStyle.Regular), Color.FromName("Black")));
- //Chart2.Legends[0].Docking = Docking.Bottom; //Docking是图例的停靠位置
- //Chart2.Legends[0].Alignment = StringAlignment.Center;//Alignment属性是图例的对齐方式
- //Chart2.BackColor = Color.Transparent;
- //Chart2.ChartAreas[0].BackColor = Color.Transparent;
- //Chart2.Legends[0].BackColor = Color.Transparent;
- foreach (DataPoint point in Chart2.Series[0].Points)
- {
- point["Exploded"] = "false";
- if (point.AxisLabel == "作业时间")
- {
- point["Exploded"] = "true";
- point.Color = chartColors[0];
- }
- if (point.AxisLabel == "停机时间")
- {
- point.Color = chartColors[0];
- }
- }
- }
- //以下代码生成右侧饼图(Pie 作业时间 + 停机时间)
- private void Build_ChartPie1(DataTable dt)
- {
- //初始化图控件,设置公共属性
- Chart_Initial(Chart2);
- var query = from r in dt.AsEnumerable()
- where r.Field<string>("DEPT") == "作业时间"
- group r by r.Field<string>("DEPT")
- into s
- select new
- {
- DEPT = s.Select(m => m.Field<string>("DEPT")).First(),
- OPTIME = s.Sum(p => p.Field<decimal>("OPTIME"))
- };
- var query1 = from r in dt.AsEnumerable()
- where r.Field<string>("DEPT") != "作业时间"
- group r by r.Field<string>("DEPT")
- into s
- select new
- {
- DEPT = s.Select(m => m.Field<string>("DEPT")).First(),
- OPTIME = s.Sum(p => p.Field<decimal>("OPTIME"))
- };
- //Get the names of Cities.
- decimal zytime = dt.AsEnumerable().Where(r=>r.Field<string>("DEPT") == "作业时间").Sum(r => r.Field<decimal>("OPTIME"));
- decimal tjtime = dt.AsEnumerable().Where(r => r.Field<string>("DEPT") != "作业时间").Sum(r => r.Field<decimal>("OPTIME"));
- string[] x = {"作业时间","停机时间"};
- //Get the Total of Orders for each City.
- decimal[] y = {zytime,tjtime};
- Chart2.Series.Add(new Series());
- Chart2.Series[0].ChartType = SeriesChartType.Pie;
- Chart2.Series[0].Points.DataBindXY(x, y);
- foreach (DataPoint p in Chart2.Series[0].Points)
- {
- if (p.AxisLabel == "作业时间")
- {
- p.Color = chartColors[0];
- }
- if (p.AxisLabel == "停机时间")
- {
- p.Color = chartColors[2];
- }
- }
- //Chart2.Series[0]["PieLabelStyle"] = "Outside";
- //Chart2.Legends[0].Enabled = true;
- //Chart2.Series[0]["PieLabelStyle"] = "Outside";
- for (int i = 0; i < Chart2.Series[0].Points.Count; i++)
- {
- DataPoint p = Chart2.Series[0].Points[i];
- //p.Label = x[i] + " #PERCENT{P2}";
- p.Label = " #PERCENT{P2}";
- p.LegendText = x[i];
- }
- Chart2.ChartAreas[0].Area3DStyle.Enable3D = true;
- string deptName = ucb1.Text;
- Chart2.Titles.Add(new Title(deptName + "作业停机图", Docking.Top, new Font("Arial Unicode MS", float.Parse("15"), FontStyle.Regular), Color.FromName("Black")));
- //Chart2.Legends[0].Docking = Docking.Bottom; //Docking是图例的停靠位置
- //Chart2.Legends[0].Alignment = StringAlignment.Center;//Alignment属性是图例的对齐方式
- //Chart2.BackColor = Color.Transparent;
- //Chart2.ChartAreas[0].BackColor = Color.Transparent;
- //Chart2.Legends[0].BackColor = Color.Transparent;
- foreach (DataPoint point in Chart2.Series[0].Points)
- {
- point["Exploded"] = "false";
- if (point.AxisLabel == "作业时间")
- {
- point["Exploded"] = "true";
- }
- }
- }
- //以下代码生成右侧饼图(Pie 停机时间)
- private void Build_ChartPie2(DataTable dt)
- {
- //初始化图控件,设置公共属性
- Chart_Initial(Chart3);
- var query = from r in dt.AsEnumerable()
- where r.Field<string>("DEPT") != "作业时间"
- group r by r.Field<string>("DEPT")
- into s
- select new
- {
- DEPT = s.Select(m => m.Field<string>("DEPT")).First(),
- OPTIME = s.Sum(p => p.Field<decimal>("OPTIME"))
- };
- //Get the names of Cities.
- string[] x = query.Select(p => p.DEPT).ToArray();
- //Get the Total of Orders for each City.
- decimal[] y = query.Select(p => p.OPTIME).ToArray();
- Chart3.Series.Add(new Series());
- Chart3.Series[0].ChartType = SeriesChartType.Pie;
- Chart3.Series[0].Points.DataBindXY(x, y);
- //foreach (DataPoint p in Chart3.Series[0].Points)
- //{
- // p.Label = x[0] + " #PERCENT{P2}";
- //}
- Chart3.Series[0]["PieLabelStyle"] = "Outside";
- Chart3.Legends[0].Enabled = true;
- //Chart3.Series[0]["PieLabelStyle"] = "Outside";
- Chart3.Series[0]["3DLabelLineSize"] = "30";
- Chart3.Series[0]["MinimumRelativePieSize"] = "30";
- for (int i = 0; i < Chart3.Series[0].Points.Count; i++)
- {
- DataPoint p = Chart3.Series[0].Points[i];
- //p.Label = x[i] +Environment.NewLine+ " #PERCENT{P2}";
- //p.Label = " #PERCENT{P2}";
- p.Label = x[i] + " #PERCENT{P2}";
- p.LegendText = x[i];
- }
- Chart3.ChartAreas[0].Area3DStyle.Enable3D = true;
- Chart3.Series[0].SmartLabelStyle.Enabled = true;
- Chart3.Series[0].SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.No;
- Chart3.Series[0].SmartLabelStyle.CalloutLineAnchorCapStyle = LineAnchorCapStyle.None;
- Chart3.Series[0].SmartLabelStyle.CalloutLineColor = Color.Red;
- Chart3.Series[0].SmartLabelStyle.CalloutLineWidth = 1;
- Chart3.Series[0].SmartLabelStyle.CalloutStyle = LabelCalloutStyle.None;
- string deptName = ucb1.Text;
- Chart3.Titles.Add(new Title(deptName + "停机责任图", Docking.Top, new Font("Arial Unicode MS", float.Parse("15"), FontStyle.Regular), Color.FromName("Black")));
- //Chart3.Legends[0].Docking = Docking.Bottom; //Docking是图例的停靠位置
- //Chart3.Legends[0].Alignment = StringAlignment.Center;//Alignment属性是图例的对齐方式
- //Chart3.BackColor = Color.Transparent;
- //Chart3.ChartAreas[0].BackColor = Color.Transparent;
- //Chart3.Legends[0].BackColor = Color.Transparent;
- foreach (DataPoint point in Chart3.Series[0].Points)
- {
- point["Exploded"] = "false";
- if (point.AxisLabel == "作业时间")
- {
- point["Exploded"] = "true";
- }
- }
- }
- //以下代码相应左侧柱状图鼠标移动事件
- private void Chart1_GetToolTipText(object sender, System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs e)
- {
- if (e.HitTestResult.ChartElementType == ChartElementType.DataPoint)
- {
- int i = e.HitTestResult.PointIndex;
- DataPoint dp = e.HitTestResult.Series.Points[i];
- string dept = e.HitTestResult.Series.Name;
- if (dept == "作业率")
- {
- string percent = Math.Round((Chart1.Series["作业时间"].Points[i].YValues[0] * 100 / 24), 2).ToString("0.00") + "%";
- e.Text = string.Format("日期:{0};\n{2}:{1:F2} ", DateTime.FromOADate(dp.XValue).ToString("yy-M-dd"), percent, dept);
- }
- else
- {
- //分别显示x轴和y轴的数值,其中{1:F3},表示显示的是float类型,精确到小数点后3位。
- e.Text = string.Format("日期:{0};\n{2}:{1:F2}小时 ", DateTime.FromOADate(dp.XValue).ToString("yy-M-dd"), dp.YValues[0], dept);
- }
- }
- }
- private int DateDiff(DateTime dateStart, DateTime dateEnd)
- {
- DateTime start = Convert.ToDateTime(dateStart.ToShortDateString());
- DateTime end = Convert.ToDateTime(dateEnd.ToShortDateString());
- TimeSpan sp = end.Subtract(start);
- return sp.Days;
- }
- private void btn_month_Click(object sender, EventArgs e)
- {
- this.startDate.Value = this.endDate.Value.AddMonths(-1);
- }
- private void ucb1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
- {
- this.ucb1.DisplayMember = "plinename";
- this.ucb1.ValueMember = "plinecode";
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- angle += 1;
- if (angle >= 360)
- {
- angle = 0;
- }
- Chart2.Series[0]["PieStartAngle"] = angle.ToString();
- PieExploed(angle);
- }
- private void timer2_Tick(object sender, EventArgs e)
- {
- angle1 += 1;
- if (angle1 >= 360)
- {
- angle1 = 0;
- }
- Chart3.Series[0]["PieStartAngle"] = angle1.ToString();
- PieExploed1(angle);
- }
- //图点索引
- private int index = 0;
- private void PieExploed(int angle)
- {
- if (angle == 1)
- {
- Chart2.Series[0].Points[0]["Exploded"] = "true";
- }
- if (angle % 30 == 0)
- {
- foreach (DataPoint point in Chart2.Series[0].Points)
- {
- point["Exploded"] = "false";
- }
- Chart2.Series[0].Points[index]["Exploded"] = "true";
- if (index == Chart2.Series[0].Points.Count - 1)
- {
- index = 0;
- }
- else
- {
- index++;
- }
- }
- }
- private int index1 = 0;
- private void PieExploed1(int angle)
- {
- if (angle == 1)
- {
- Chart3.Series[0].Points[0]["Exploded"] = "true";
- }
- if (angle % 30 == 0)
- {
- foreach (DataPoint point in Chart3.Series[0].Points)
- {
- point["Exploded"] = "false";
- }
- Chart3.Series[0].Points[index1]["Exploded"] = "true";
- if (index1 == Chart3.Series[0].Points.Count - 1)
- {
- index1 = 0;
- }
- else
- {
- index1++;
- }
- }
- }
- //旋转停止
- private void toolStripMenuItem1_Click(object sender, EventArgs e)
- {
- if (chartActive != null)
- {
- if (chartActive.Name == "Chart2")
- {
- this.timer1.Enabled = !this.timer1.Enabled;
- }
- if (chartActive.Name == "Chart3")
- {
- this.timer2.Enabled = !this.timer2.Enabled;
- }
- }
- }
- //另存为
- private void toolStripMenuItem4_Click(object sender, EventArgs e)
- {
- if (chartActive != null)
- {
- // Create a new save file dialog
- SaveFileDialog saveFileDialog1 = new SaveFileDialog();
- // Sets the current file name filter string, which determines
- // the choices that appear in the "Save as file type" or
- // "Files of type" box in the dialog box.
- saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif";
- saveFileDialog1.FilterIndex = 2;
- saveFileDialog1.RestoreDirectory = true;
- // Set image file format
- if (saveFileDialog1.ShowDialog() == DialogResult.OK)
- {
- ChartImageFormat format = ChartImageFormat.Bmp;
- if (saveFileDialog1.FileName.EndsWith("bmp"))
- {
- format = ChartImageFormat.Bmp;
- }
- else if (saveFileDialog1.FileName.EndsWith("jpg"))
- {
- format = ChartImageFormat.Jpeg;
- }
- else if (saveFileDialog1.FileName.EndsWith("emf"))
- {
- format = ChartImageFormat.Emf;
- }
- else if (saveFileDialog1.FileName.EndsWith("gif"))
- {
- format = ChartImageFormat.Gif;
- }
- else if (saveFileDialog1.FileName.EndsWith("png"))
- {
- format = ChartImageFormat.Png;
- }
- else if (saveFileDialog1.FileName.EndsWith("tif"))
- {
- format = ChartImageFormat.Tiff;
- }
- chartActive.BackColor = Color.White;
- chartActive.ChartAreas[0].BackColor = Color.White;
- chartActive.Legends[0].BackColor = Color.White;
- // Save image
- chartActive.SaveImage(saveFileDialog1.FileName, format);
- }
- chartActive.BackColor = Color.Transparent;
- chartActive.ChartAreas[0].BackColor = Color.Transparent;
- chartActive.Legends[0].BackColor = Color.Transparent;
- }
- }
- //拷贝
- private void toolStripMenuItem3_Click(object sender, EventArgs e)
- {
- if (chartActive != null)
- {
- chartActive.BackColor = Color.White;
- chartActive.ChartAreas[0].BackColor = Color.White;
- chartActive.Legends[0].BackColor = Color.White;
- // create a memory stream to save the chart image
- System.IO.MemoryStream stream = new System.IO.MemoryStream();
- // save the chart image to the stream
- chartActive.SaveImage(stream, System.Drawing.Imaging.ImageFormat.Bmp);
- // create a bitmap using the stream
- Bitmap bmp = new Bitmap(stream);
- // save the bitmap to the clipboard
- Clipboard.SetDataObject(bmp);
- chartActive.BackColor = Color.Transparent;
- chartActive.ChartAreas[0].BackColor = Color.Transparent;
- chartActive.Legends[0].BackColor = Color.Transparent;
- MessageUtil.ShowTips("图片已拷贝至剪切板!");
- }
- }
- //鼠标进入 chart控件获取焦点
- private void Chart_MouseEnter(object sender, EventArgs e)
- {
- Chart chart = sender as Chart;
- if (chart != null)
- {
- chartActive = chart;
- chart.Focus();
- }
- }
- private void Chart_KeyDown(object sender, KeyEventArgs e)
- {
- this.ctrlKeyDown = e.Control;
- this.shiftKeyDown = e.Shift;
- }
- private void Chart_KeyUp(object sender, KeyEventArgs e)
- {
- this.ctrlKeyDown = e.Control;
- this.shiftKeyDown = e.Shift;
- }
-
- //右键菜单打开事件(正在打开时)
- private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
- {
- ContextMenuStrip ctx = sender as ContextMenuStrip;
- Control control = ctx.SourceControl;
- Chart chart = control as Chart;
- if (chart != null)
- {
- //Chart1 柱状图屏蔽 转动命令
- if (chart.Name == "Chart1")
- {
- ctx.Items[0].Visible = false;
- }
- else
- {
- ctx.Items[0].Visible = true;
- }
- }
- }
- //初始化数据源,为部门、产销下拉列表准备
- private void initial_UltraDataSource1()
- {
- UltraDataRow row;
- // Initialize rows with data.
- // Get the first row.
- this.ultraDataSource1.Rows.SetCount(37);
- int index = 0;
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "全部";
- row["plinecode"] = "-1";
- row["plinename"] = "全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "炼钢厂全部";
- row["plinecode"] = "A";
- row["plinename"] = "炼钢厂全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "炼钢厂";
- row["plinename2"] = "一炼钢";
- row["plinecode"] = "C001";
- row["plinename"] = "一炼钢";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "炼钢厂";
- row["plinename2"] = "二炼钢";
- row["plinecode"] = "C003";
- row["plinename"] = "二炼钢";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "轧管厂全部";
- row["plinecode"] = "D";
- row["plinename"] = "轧管厂全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "轧管厂";
- row["plinename2"] = "250机组";
- row["plinecode"] = "C008";
- row["plinename"] = "250机组";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "轧管厂";
- row["plinename2"] = "258机组";
- row["plinecode"] = "C009";
- row["plinename"] = "258机组";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "轧管厂";
- row["plinename2"] = "168机组";
- row["plinecode"] = "C010";
- row["plinename"] = "168机组";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "轧管厂";
- row["plinename2"] = "460机组";
- row["plinecode"] = "C017";
- row["plinename"] = "460机组";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉全部";
- row["plinecode"] = "F0";
- row["plinename"] = "管加工热处理炉全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "全部";
- row["plinecode"] = "F01";
- row["plinename"] = "管加工热处理炉本部全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "1#热处理";
- row["plinecode"] = "C0220";
- row["plinename"] = "1#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "2#热处理";
- row["plinecode"] = "C0230";
- row["plinename"] = "2#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "3#热处理";
- row["plinecode"] = "C0240";
- row["plinename"] = "3#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "4#热处理";
- row["plinecode"] = "C0250";
- row["plinename"] = "4#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "本部";
- row["plinename2"] = "5#热处理";
- row["plinecode"] = "C0260";
- row["plinename"] = "5#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "深加工";
- row["plinename2"] = "全部";
- row["plinecode"] = "F02";
- row["plinename"] = "管加工热处理炉深加工全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "深加工";
- row["plinename2"] = "6#热处理";
- row["plinecode"] = "C0540";
- row["plinename"] = "6#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "深加工";
- row["plinename2"] = "7#热处理";
- row["plinecode"] = "C0550";
- row["plinename"] = "7#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "深加工";
- row["plinename2"] = "8#热处理";
- row["plinecode"] = "C0480";
- row["plinename"] = "8#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "元通";
- row["plinename2"] = "全部";
- row["plinecode"] = "F03";
- row["plinename"] = "管加工热处理炉元通全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "元通";
- row["plinename2"] = "9#热处理";
- row["plinecode"] = "C0490";
- row["plinename"] = "9#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理炉";
- row["plinename1"] = "元通";
- row["plinename2"] = "10#热处理";
- row["plinecode"] = "C0500";
- row["plinename"] = "10#热处理炉";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤全部";
- row["plinecode"] = "F1";
- row["plinename"] = "管加工热处理探伤全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "全部";
- row["plinecode"] = "F11";
- row["plinename"] = "管加工热处理探伤本部全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "1#热处理";
- row["plinecode"] = "C0221";
- row["plinename"] = "1#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "2#热处理";
- row["plinecode"] = "C0231";
- row["plinename"] = "2#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "3#热处理";
- row["plinecode"] = "C0241";
- row["plinename"] = "3#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "4#热处理";
- row["plinecode"] = "C0251";
- row["plinename"] = "4#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "本部";
- row["plinename2"] = "5#热处理";
- row["plinecode"] = "C0261";
- row["plinename"] = "5#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "深加工";
- row["plinename2"] = "全部";
- row["plinecode"] = "F12";
- row["plinename"] = "管加工热处理探伤深加工全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "深加工";
- row["plinename2"] = "6#热处理";
- row["plinecode"] = "C0541";
- row["plinename"] = "6#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "深加工";
- row["plinename2"] = "7#热处理";
- row["plinecode"] = "C0551";
- row["plinename"] = "7#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "深加工";
- row["plinename2"] = "8#热处理";
- row["plinecode"] = "C0481";
- row["plinename"] = "8#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "元通";
- row["plinename2"] = "全部";
- row["plinecode"] = "F13";
- row["plinename"] = "管加工热处理探伤元通全部";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "元通";
- row["plinename2"] = "9#热处理";
- row["plinecode"] = "C0491";
- row["plinename"] = "9#热处理探伤";
- row = this.ultraDataSource1.Rows[index++];
- row["dept"] = "管加工热处理探伤";
- row["plinename1"] = "元通";
- row["plinename2"] = "10#热处理";
- row["plinecode"] = "C0501";
- row["plinename"] = "10#热处理探伤";
- }
-
- }
- }
|