private void _helper_DomainObjectToGridRow(object sender, EventArgs e) { if ((e as DomainObjectToGridRowEventArgs).DomainObject != null) { OQCErrorCode obj = (e as DomainObjectToGridRowEventArgs).DomainObject as OQCErrorCode; ArrayList objList = new ArrayList(); objList.Add(obj.ErrorCodeDesc); objList.Add(obj.ErrorCodeCardQty); objList.Add(obj.ItemCode); objList.Add(obj.ItemCardQty); (e as DomainObjectToGridRowEventArgs).GridRow = new UltraGridRow(objList.ToArray()); } }
private void _helper_DomainObjectToExportRow(object sender, EventArgs e) { if ((e as DomainObjectToExportRowEventArgs).DomainObject != null) { OQCErrorCode obj = (e as DomainObjectToGridRowEventArgs).DomainObject as OQCErrorCode; ArrayList objList = new ArrayList(); objList.Add(obj.ErrorCodeDesc); objList.Add(obj.ErrorCodeCardQty); objList.Add(obj.ItemCode); objList.Add(obj.ItemCardQty); (e as DomainObjectToExportRowEventArgs).ExportRow = (string[])objList.ToArray(typeof(string)); } }
private void _processOWC(object[] dataSource) { this.OWCChartSpace1.ClearCharts(); if (dataSource != null) { string[] categories = new string[dataSource.Length]; object[] ColumnClusteredValues = new object[dataSource.Length]; //柱状图values object[] ParetoValues = new object[dataSource.Length]; //柏拉图values int iTotal = 0; for (int i = 0; i < dataSource.Length; i++) { OQCErrorCode oqcErr = (OQCErrorCode)dataSource[i]; iTotal += Convert.ToInt32(oqcErr.ErrorCodeCardQty); } for (int i = 0; i < dataSource.Length; i++) { OQCErrorCode oqcErr = (OQCErrorCode)dataSource[i]; categories[i] = oqcErr.ErrorCodeDesc; ColumnClusteredValues[i] = oqcErr.ErrorCodeCardQty; ParetoValues[i] = this.getParetoValue(dataSource, iTotal, i); } this.OWCChartSpace1.ChartCombinationType = OWCChartCombinationType.OWCCombinationPareto; //设置多图组合绘图方式为Pareto 柏拉图 this.OWCChartSpace1.AddChart("数量", categories, ColumnClusteredValues); //默认添加柱状图 this.OWCChartSpace1.AddChart("百分比", categories, ParetoValues, OWCChartType.LineMarkers); //柏拉图 int majorUnit = GetMahorUnit(iTotal); //设置左Y轴最小单元刻度,避免小于5的时候出现小数单元. if (majorUnit > 0) { this.OWCChartSpace1.ChartLeftMajorUnit = majorUnit; } this.OWCChartSpace1.ChartLeftMaximum = iTotal; //设置左Y轴最大刻度 this.OWCChartSpace1.Display = true; } }