Exemplo n.º 1
0
        protected override void DrawChartWithSeriesInfo()
        {
            SeriesInfo   si        = null;
            ChartUtility chartUtil = new ChartUtility();
            int          iCount    = (int)ChartUtility.CHAERT_SERIES_COLOR.COUNT;

            for (int i = 0; i < this.dtDataSource.Columns.Count; i++)
            {
                string seriesName = this.dtDataSource.Columns[i].ColumnName;

                if (seriesName == CommonChart.COLUMN_NAME_SEQ_INDEX || seriesName == Definition.CHART_COLUMN.TIME || seriesName == Definition.CHART_COLUMN.TIME2 ||
                    seriesName == Definition.COL_TOGGLE || seriesName == Definition.COL_TOGGLE_YN || seriesName == Definition.CHART_COLUMN.DTSOURCEID ||
                    lstRawColumn.Contains(seriesName))
                {
                    continue;
                }
                si = new SeriesInfo(typeof(Line), seriesName, this.dtDataSource, CommonChart.COLUMN_NAME_SEQ_INDEX, seriesName);


                switch (seriesName)
                {
                case Definition.CHART_COLUMN.UCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.UCL); break;

                case Definition.CHART_COLUMN.LCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LCL); break;

                case Definition.CHART_COLUMN.LSL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LSL); break;

                case Definition.CHART_COLUMN.USL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.USL); break;

                case Definition.CHART_COLUMN.MIN: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.MIN); break;

                case Definition.CHART_COLUMN.MAX: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.MAX); break;

                case Definition.CHART_COLUMN.TARGET: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.TARGET); break;

                default:
                    if ((seriesName == Definition.CHART_COLUMN.RAW) ||
                        (seriesName == Definition.CHART_COLUMN.STDDEV) ||
                        (seriesName == Definition.CHART_COLUMN.AVG) ||
                        (seriesName == Definition.CHART_COLUMN.RANGE) ||
                        (seriesName == Definition.CHART_COLUMN.MA) ||
                        (seriesName == Definition.CHART_COLUMN.MSD) ||
                        (seriesName == Definition.CHART_COLUMN.MR) ||
                        (seriesName == Definition.CHART_COLUMN.MEAN) ||
                        (seriesName == Definition.CHART_COLUMN.EWMAMEAN) ||
                        (seriesName == Definition.CHART_COLUMN.EWMARANGE) ||
                        (seriesName == Definition.CHART_COLUMN.EWMASTDDEV))
                    {
                        si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.AVG);
                    }
                    else
                    {
                        si.SeriesColor = chartUtil.GetSeriesColor(iCount++);
                    }

                    break;
                }
                this.DrawChart(si);
            }
        }
Exemplo n.º 2
0
        private void DrawChart()
        {
            SeriesInfo si = null;

            if (this._dtChartData.Rows.Count > 0)
            {
                for (int i = 0; i < this._dtChartData.Columns.Count; i++)
                {
                    string seriesName = this._dtChartData.Columns[i].ColumnName.ToUpper();
                    if (seriesName == "RAW" || seriesName == "RAW_UCL" || seriesName == "RAW_LCL" || seriesName == "RAW_LSL" || seriesName == "RAW_USL" || seriesName == "RAW_TARGET")
                    {
                        si = new SeriesInfo(typeof(Line), seriesName, this._dtChartData, CommonChart.COLUMN_NAME_SEQ_INDEX, seriesName.ToLower());
                        switch (seriesName)
                        {
                        case "RAW_UCL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.UCL); break;

                        case "RAW_LCL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LCL); break;

                        case "RAW_LSL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LSL); break;

                        case "RAW_USL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.USL); break;

                        case "RAW_TARGET": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.TARGET); break;

                        case "RAW": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.AVG); break;
                        }
                        this.bTChrt_RawData.AddSeries(si);
                    }
                }

                Series s = null;
                for (int i = 0; i < this.bTChrt_RawData.Chart.Series.Count; i++)
                {
                    s = this.bTChrt_RawData.Chart.Series[i];

                    ((Line)s).LinePen.Width   = 2;
                    ((Line)s).OutLine.Visible = false;
                    ((Line)s).ColorEachLine   = false;
                    ((Line)s).Pointer.Visible = false;
                    ((Line)s).Active          = true;

                    if (s.Title == "RAW")
                    {
                        ((Line)s).LinePen.Width   = 1;
                        ((Line)s).Pointer.Visible = true;
                    }
                }
                //added by enkim 2012.12.12 SPC-839
                if (!this.bTChrt_RawData.Chart.Axes.Left.Labels.ValueFormat.Contains("E"))
                {
                    this.bTChrt_RawData.Chart.Axes.Left.Labels.ValueFormat = "#,##0.###";
                }
                this.bTChrt_RawData.XAxisLabel = BTeeChart.XAxisLabelType.LABEL;
                this.bTChrt_RawData.Chart.Axes.Bottom.Labels.ValueFormat = "yy-MM-dd";
                this.bTChrt_RawData.ChangeXLabelColumnDefault("TIME2");
                this.bTChrt_RawData.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.OneDay];
                this.bTChrt_RawData.Refresh();
            }
        }
Exemplo n.º 3
0
        protected override void DrawChartWithSeriesInfoForSumChart()
        {
            SeriesInfo   si        = null;
            ChartUtility chartUtil = new ChartUtility();
            int          iCount    = (int)ChartUtility.CHAERT_SERIES_COLOR.COUNT;

            for (int i = 0; i < this.dtDataSource.Columns.Count; i++)
            {
                string seriesName = this.dtDataSource.Columns[i].ColumnName;

                if (seriesName == CommonChart.COLUMN_NAME_SEQ_INDEX ||
                    seriesName == Definition.CHART_COLUMN.TIME ||
                    seriesName == Definition.CHART_COLUMN.TIME2 ||
                    seriesName == Definition.CHART_COLUMN.DTSOURCEID ||
                    seriesName == Definition.COL_TOGGLE_YN ||
                    lstRawColumn.Contains(seriesName))
                {
                    continue;
                }

                si            = new SeriesInfo(typeof(ExtremeBFastLine), seriesName, this.dtDataSource, CommonChart.COLUMN_NAME_SEQ_INDEX, seriesName);
                si.TreatNulls = TreatNullsStyle.DoNotPaint;

                switch (seriesName)
                {
                case Definition.CHART_COLUMN.UCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.UCL); break;

                case Definition.CHART_COLUMN.LCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LCL); break;

                case Definition.CHART_COLUMN.LSL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LSL); break;

                case Definition.CHART_COLUMN.USL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.USL); break;

                case Definition.CHART_COLUMN.TARGET: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.TARGET); break;

                default:
                    if ((seriesName == Definition.CHART_COLUMN.P) ||
                        (seriesName == Definition.CHART_COLUMN.PN) ||
                        (seriesName == Definition.CHART_COLUMN.C) ||
                        (seriesName == Definition.CHART_COLUMN.U))
                    {
                        si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.AVG);
                    }
                    else
                    {
                        si.SeriesColor = chartUtil.GetSeriesColor(iCount++);
                    }

                    break;
                }
                this.DrawChart(si);
            }
        }
Exemplo n.º 4
0
        protected override void DrawChartWithRawSeriesInfo()
        {
            SeriesInfo   si        = null;
            ChartUtility chartUtil = new ChartUtility();
            DataTable    dtTemp    = new DataTable();
            ArrayList    arrTemp   = new ArrayList();
            Type         tempType  = null;
            LinkedList   lnkList   = new LinkedList();

            for (int i = 0; i < this.dtDataSource.Columns.Count; i++)
            {
                string seriesName     = this.dtDataSource.Columns[i].ColumnName;
                string seriesNameTemp = this.dtDataSource.Columns[i].ColumnName.Split('^')[0];

                if (seriesName == CommonChart.COLUMN_NAME_SEQ_INDEX)
                {
                    tempType = this.dtDataSource.Rows[0][i].GetType();
                }
                else if (lstRawColumn.Contains(seriesName))
                {
                    if (dtTemp.Columns.Contains(seriesNameTemp))
                    {
                        continue;
                    }
                    else if (!lnkList.Contains(seriesNameTemp))
                    {
                        dtTemp = new DataTable();
                        dtTemp.Columns.Add(CommonChart.COLUMN_NAME_SEQ_INDEX, tempType);
                        for (int k = 0; k < this.dtDataSource.Rows.Count; k++)
                        {
                            if (this.dtDataSource.Rows[k][i] != null && this.dtDataSource.Rows[k][i].ToString().Length > 0)
                            {
                                dtTemp.Columns.Add(seriesNameTemp, this.dtDataSource.Rows[k][i].GetType());
                                break;
                            }
                        }
                        lnkList.Add(seriesNameTemp, dtTemp.Clone());
                        arrTemp.Add(seriesNameTemp);
                    }
                }
            }

            if (lnkList.Count > 0)
            {
                for (int i = 0; i < arrTemp.Count; i++)
                {
                    DataRow   dr = null;
                    DataTable dt = new DataTable();
                    dt = ((DataTable)lnkList[arrTemp[i].ToString()]).Clone();
                    string sTempColumnName = dt.Columns[1].ColumnName;

                    for (int j = 0; j < this.dtDataSource.Rows.Count; j++)
                    {
                        for (int k = 0; k < this.dtDataSource.Columns.Count; k++)
                        {
                            if (this.dtDataSource.Columns[k].ColumnName.Split('^')[0] == sTempColumnName)
                            {
                                if (this.dtDataSource.Rows[j][k] != null && this.dtDataSource.Rows[j][k].ToString().Length > 0)
                                {
                                    dr    = dt.NewRow();
                                    dr[0] = dtDataSource.Rows[j][CommonChart.COLUMN_NAME_SEQ_INDEX];;
                                    dr[1] = dtDataSource.Rows[j][k];
                                    dt.Rows.Add(dr);
                                }
                            }
                        }
                    }
                    lnkList.Remove(arrTemp[i].ToString());
                    lnkList.Add(arrTemp[i].ToString(), dt);
                }

                for (int i = 0; i < arrTemp.Count; i++)
                {
                    si             = new SeriesInfo(typeof(Line), arrTemp[i].ToString(), ((DataTable)lnkList[arrTemp[i].ToString()]), CommonChart.COLUMN_NAME_SEQ_INDEX, arrTemp[i].ToString());
                    si.SeriesColor = chartUtil.GetSeriesColor(i);
                    this.DrawChart(si);
                }
            }
        }
Exemplo n.º 5
0
        protected override void DrawChartWithRawSeriesInfo()
        {
            SeriesInfo   si        = null;
            ChartUtility chartUtil = new ChartUtility();
            DataTable    dtTemp    = new DataTable();
            ArrayList    arrTemp   = new ArrayList();
            Type         tempType  = null;
            LinkedList   lnkList   = new LinkedList();

            if (this.dtDataSource.Rows.Count == 0)
            {
                return;
            }

            for (int i = 0; i < this.dtDataSource.Columns.Count; i++)
            {
                string seriesName     = this.dtDataSource.Columns[i].ColumnName;
                string seriesNameTemp = this.dtDataSource.Columns[i].ColumnName.Split('^')[0];

                if (seriesName == CommonChart.COLUMN_NAME_SEQ_INDEX)
                {
                    tempType = this.dtDataSource.Rows[0][i].GetType();
                }
                else if (lstRawColumn.Contains(seriesName))
                {
                    if (dtTemp.Columns.Contains(seriesNameTemp))
                    {
                        continue;
                    }
                    else if (!lnkList.Contains(seriesNameTemp))
                    {
                        dtTemp = new DataTable();
                        dtTemp.Columns.Add(CommonChart.COLUMN_NAME_SEQ_INDEX, tempType);
                        for (int k = 0; k < this.dtDataSource.Rows.Count; k++)
                        {
                            if (this.dtDataSource.Rows[k][i] != null && this.dtDataSource.Rows[k][i].ToString().Length > 0)
                            {
                                dtTemp.Columns.Add(seriesNameTemp, this.dtDataSource.Rows[k][i].GetType());
                                break;
                            }
                        }
                        lnkList.Add(seriesNameTemp, dtTemp.Clone());
                        arrTemp.Add(seriesNameTemp);
                    }
                }
            }

            if (lnkList.Count > 0)
            {
                for (int i = 0; i < arrTemp.Count; i++)
                {
                    DataRow   dr = null;
                    DataTable dt = new DataTable();
                    dt = ((DataTable)lnkList[arrTemp[i].ToString()]).Clone();
                    if (dt.Columns.Count > 1)
                    {
                        string sTempColumnName = dt.Columns[1].ColumnName;

                        for (int j = 0; j < this.dtDataSource.Rows.Count; j++)
                        {
                            for (int k = 0; k < this.dtDataSource.Columns.Count; k++)
                            {
                                if (this.dtDataSource.Columns[k].ColumnName.Split('^')[0] == sTempColumnName)
                                {
                                    if (this.dtDataSource.Rows[j][k] != null && this.dtDataSource.Rows[j][k].ToString().Length > 0)
                                    {
                                        dr    = dt.NewRow();
                                        dr[0] = dtDataSource.Rows[j][CommonChart.COLUMN_NAME_SEQ_INDEX];;
                                        dr[1] = dtDataSource.Rows[j][k];
                                        dt.Rows.Add(dr);
                                    }
                                }
                            }
                        }
                        lnkList.Remove(arrTemp[i].ToString());
                        lnkList.Add(arrTemp[i].ToString(), dt);
                    }
                }

                int jcolor = 0;

                for (int i = 0; i < arrTemp.Count; i++)
                {
                    si             = new SeriesInfo(typeof(Line), arrTemp[i].ToString(), ((DataTable)lnkList[arrTemp[i].ToString()]), CommonChart.COLUMN_NAME_SEQ_INDEX, arrTemp[i].ToString());
                    si.SeriesColor = chartUtil.GetSeriesColor(i);
                    if (si.SeriesColor == Color.Red || si.SeriesColor == Color.Black)
                    {
                        jcolor++;
                        si.SeriesColor = chartUtil.GetSeriesColor(jcolor);
                    }
                    this.DrawChart(si);
                    jcolor++;
                }
            }
            //si = new SeriesInfo(typeof(Line), seriesName, this.dtDataSource, CommonChart.COLUMN_NAME_SEQ_INDEX, seriesName);


            //switch (seriesName)
            //{
            //    case Definition.CHART_COLUMN.UCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.UCL); break;
            //    case Definition.CHART_COLUMN.LCL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LCL); break;
            //    case Definition.CHART_COLUMN.LSL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LSL); break;
            //    case Definition.CHART_COLUMN.USL: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.USL); break;
            //    case Definition.CHART_COLUMN.MIN: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.MIN); break;
            //    case Definition.CHART_COLUMN.MAX: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.MAX); break;
            //    case Definition.CHART_COLUMN.TARGET: si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.TARGET); break;
            //    default:
            //        if ((seriesName == Definition.CHART_COLUMN.RAW)
            //           || (seriesName == Definition.CHART_COLUMN.STDDEV)
            //           || (seriesName == Definition.CHART_COLUMN.AVG)
            //           || (seriesName == Definition.CHART_COLUMN.RANGE)
            //           || (seriesName == Definition.CHART_COLUMN.MA)
            //           || (seriesName == Definition.CHART_COLUMN.MSD)
            //           || (seriesName == Definition.CHART_COLUMN.MEAN)
            //           || (seriesName == Definition.CHART_COLUMN.EWMAMEAN)
            //           || (seriesName == Definition.CHART_COLUMN.EWMARANGE)
            //           || (seriesName == Definition.CHART_COLUMN.EWMASTDDEV))
            //        {
            //            si.SeriesColor = chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.AVG);
            //        }
            //        else
            //            si.SeriesColor = chartUtil.GetSeriesColor(iCount++);

            //        break;
            //}
            //this.DrawChart(si);
            //}
        }
Exemplo n.º 6
0
        ///////////////////////////////////////////////////////////////////////////////////
        public virtual bool DrawSPCChart()
        {
            try
            {
                if (this.DataManager.RawDataTable.Rows.Count < 1)
                {
                    return(false);
                }



                for (int i = 0; i < this.DataManager.RawDataTable.Columns.Count; i++)
                {
                    if (this.DataManager.RawDataTable.Columns[i].ColumnName.Contains("wafer"))
                    {
                        isWaferColumn = true;
                        break;
                    }
                }

                if (isWaferColumn)
                {
                    this._mllstContextType.Add("TIME", null);
                    this._mllstContextType.Add("RAW", null);
                    this._mllstContextType.Add("RAW_USL", null);
                    this._mllstContextType.Add("RAW_UCL", null);
                    this._mllstContextType.Add("RAW_TARGET", null);
                    this._mllstContextType.Add("RAW_LCL", null);
                    this._mllstContextType.Add("RAW_LSL", null);
                    this._mllstContextType.Add("PARAM_LIST", null);
                    this._mllstContextType.Add("RAW_DTTS", null);
                    if (!this._mllstContextType.Contains("EQP_ID"))
                    {
                        this._mllstContextType.Add("EQP_ID", null);
                    }
                    for (int i = 0; i < this.DataManager.RawDataTableOriginal.Columns.Count; i++)
                    {
                        if (!this._mllstContextType.Contains(this.DataManager.RawDataTableOriginal.Columns[i].ColumnName.ToUpper()))
                        {
                            this.DataManager.RawDataTableOriginal.Columns.Remove(this.DataManager.RawDataTableOriginal.Columns[i].ColumnName);
                            i--;
                        }
                    }

                    if (this.DataManager.RawDataTableOriginal.Rows.Count > 0)
                    {
                        this._dtDataSource = this.DataManager.RawDataTableOriginal.Clone();
                        DataTable dtTemp = new DataTable();
                        dtTemp = this.DataManager.RawDataTableOriginal.Clone();
                        foreach (DataRow dr in DataManager.RawDataTableOriginal.Rows)
                        {
                            dtTemp.Clear();
                            if (dr[COLUMN.RAW_DTTS].ToString().Length != 0)
                            {
                                if (dr[COLUMN.RAW_DTTS].ToString().Split(';').Length == dr["RAW"].ToString().Split(';').Length&& dr[COLUMN.RAW_DTTS].ToString().Split(';').Length == dr[COLUMN.PARAM_LIST].ToString().Split(';').Length)
                                {
                                    for (int i = 0; i < dr["RAW"].ToString().Split(';').Length; i++)
                                    {
                                        if (dr["RAW"].ToString().Split(';')[i].Length > 0)
                                        {
                                            dtTemp.ImportRow(dr);
                                        }
                                    }

                                    for (int j = 0; j < dtTemp.Rows.Count; j++)
                                    {
                                        dtTemp.Rows[j]["RAW"]             = dtTemp.Rows[j]["RAW"].ToString().Split(';')[j];
                                        dtTemp.Rows[j][COLUMN.PARAM_LIST] = dtTemp.Rows[j][COLUMN.PARAM_LIST].ToString().Split(';')[j];
                                        dtTemp.Rows[j][COLUMN.RAW_DTTS]   = dtTemp.Rows[j][COLUMN.RAW_DTTS].ToString().Split(';')[j];
                                        if (dtTemp.Rows[j]["SUBSTRATE_ID"] != null && dtTemp.Rows[j]["SUBSTRATE_ID"].ToString().Length > 0 && dtTemp.Rows[j]["SUBSTRATE_ID"].ToString().Split(';').Length > 1)
                                        {
                                            dtTemp.Rows[j]["SUBSTRATE_ID"] = dtTemp.Rows[j]["SUBSTRATE_ID"].ToString().Split(';')[j];
                                        }
                                    }

                                    this._dtDataSource.Merge(dtTemp);
                                }
                            }
                            else
                            {
                                if (dr["RAW"] != null && dr["RAW"].ToString().Length > 0)
                                {
                                    dr[COLUMN.RAW_DTTS] = dr["TIME"];
                                    dtTemp.ImportRow(dr);
                                    this._dtDataSource.Merge(dtTemp);
                                }
                            }
                        }

                        if (this._dtDataSource.Rows.Count > 0)
                        {
                            this._dtDataSource = DataUtil.DataTableImportRow(this._dtDataSource.Select(null, COLUMN.RAW_DTTS));
                        }

                        if (this._dtDataSource.Columns.Contains("TIME"))
                        {
                            this.dtDataSource.Columns.Remove("TIME");
                        }

                        this._dtDataSource.Columns.Add("TIME", typeof(DateTime));
                        this._dtDataSource.Columns.Add(Definition.CHART_COLUMN.TIME2, typeof(string));
                        this._dtDataSource.Columns.Add(CommonChart.COLUMN_NAME_SEQ_INDEX, typeof(int));


                        for (int i = 0; i < this._dtDataSource.Rows.Count; i++)
                        {
                            string sTime = this._dtDataSource.Rows[i]["raw_dtts"].ToString();
                            this._dtDataSource.Rows[i][Definition.CHART_COLUMN.TIME2] = sTime.Substring(0, 16);
                            this._dtDataSource.Rows[i]["TIME"] = sTime;
                            this._dtDataSource.Rows[i][CommonChart.COLUMN_NAME_SEQ_INDEX] = i;
                        }
                    }

                    SeriesInfo si = null;
                    if (this._dtDataSource.Rows.Count > 0)
                    {
                        for (int i = 0; i < this._dtDataSource.Columns.Count; i++)
                        {
                            string seriesName = this._dtDataSource.Columns[i].ColumnName.ToUpper();
                            if (seriesName == "RAW" || seriesName == "RAW_UCL" || seriesName == "RAW_LCL" || seriesName == "RAW_LSL" || seriesName == "RAW_USL" || seriesName == "RAW_TARGET")
                            {
                                si = new SeriesInfo(typeof(Line), seriesName.Replace("RAW_", ""), this._dtDataSource, CommonChart.COLUMN_NAME_SEQ_INDEX, seriesName.ToLower());
                                switch (seriesName)
                                {
                                case "RAW_UCL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.UCL); break;

                                case "RAW_LCL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LCL); break;

                                case "RAW_LSL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.LSL); break;

                                case "RAW_USL": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.USL); break;

                                case "RAW_TARGET": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.TARGET); break;

                                case "RAW": si.SeriesColor = _chartUtil.GetSeriesColor((int)ChartUtility.CHAERT_SERIES_COLOR.AVG); break;
                                }
                                this.SPCChart.AddSeries(si);
                            }
                        }

                        Series s = null;
                        for (int i = 0; i < this.SPCChart.Chart.Series.Count; i++)
                        {
                            s = this.SPCChart.Chart.Series[i];

                            ((Line)s).LinePen.Width   = 2;
                            ((Line)s).OutLine.Visible = false;
                            ((Line)s).ColorEachLine   = false;
                            ((Line)s).Pointer.Visible = false;
                            ((Line)s).Active          = true;

                            if (s.Title == "RAW")
                            {
                                ((Line)s).LinePen.Width   = 1;
                                ((Line)s).Pointer.Visible = true;
                            }
                        }

                        this.SPCChart.XAxisLabel = BTeeChart.XAxisLabelType.LABEL;
                        this.SPCChart.Chart.Axes.Bottom.Labels.ValueFormat = "yy-MM-dd";
                        this.SPCChart.ChangeXLabelColumnDefault("TIME2");
                        this.SPCChart.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.OneDay];
                        this.SPCChart.Refresh();
                    }
                }
                else
                {
                    MakeDataSourceToDrawSPCChart();
                    DrawChartWithSeriesInfo();
                    ChangeSeriesStyle();
                }

                //added by enkim 2012.12.12 SPC-839
                if (!this.SPCChart.Chart.Axes.Left.Labels.ValueFormat.Contains("E"))
                {
                    this.SPCChart.Chart.Axes.Left.Labels.ValueFormat = "#,##0.###";
                }
                //added end

                MakeTipInfo();

                return(true);
            }
            catch (Exception ex)
            {
                MsgClose();
                this.SPCChart.ClearChart();
                LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex);
                //MSGHandler.DisplayMessage(MSGType.Error, "There is an empty or non-numeric value.");
                return(false);
            }
        }
Exemplo n.º 7
0
        //modified end SPC-851

        //modified by enkim 2012.05.21 SPC-851
        protected override void DrawChartWithRawSeriesInfoForSumChart()
        {
            SeriesInfo   si        = null;
            ChartUtility chartUtil = new ChartUtility();
            DataTable    dtTemp    = new DataTable();
            ArrayList    arrTemp   = new ArrayList();
            Type         tempType  = null;
            LinkedList   lnkList   = new LinkedList();

            if (this.dtDataSource.Rows.Count == 0)
            {
                return;
            }

            for (int i = 0; i < this.dtDataSource.Columns.Count; i++)
            {
                string seriesName     = this.dtDataSource.Columns[i].ColumnName;
                string seriesNameTemp = this.dtDataSource.Columns[i].ColumnName.Split('^')[0];

                if (seriesName == CommonChart.COLUMN_NAME_SEQ_INDEX)
                {
                    tempType = this.dtDataSource.Rows[0][i].GetType();
                }
                else if (lstRawColumn.Contains(seriesName))
                {
                    if (dtTemp.Columns.Contains(seriesNameTemp))
                    {
                        continue;
                    }
                    else if (!lnkList.Contains(seriesNameTemp))
                    {
                        dtTemp = new DataTable();
                        dtTemp.Columns.Add(CommonChart.COLUMN_NAME_SEQ_INDEX, tempType);
                        if (!dtTemp.Columns.Contains("TIME"))
                        {
                            dtTemp.Columns.Add("TIME", typeof(DateTime));
                        }
                        if (!dtTemp.Columns.Contains(Definition.CHART_COLUMN.TIME2))
                        {
                            dtTemp.Columns.Add(Definition.CHART_COLUMN.TIME2, typeof(string));
                        }

                        for (int k = 0; k < this.dtDataSource.Rows.Count; k++)
                        {
                            if (this.dtDataSource.Rows[k][i] != null && this.dtDataSource.Rows[k][i].ToString().Length > 0)
                            {
                                dtTemp.Columns.Add(seriesNameTemp, this.dtDataSource.Rows[k][i].GetType());
                                break;
                            }
                        }
                        lnkList.Add(seriesNameTemp, dtTemp.Clone());
                        arrTemp.Add(seriesNameTemp);
                    }
                }
            }

            if (lnkList.Count > 0)
            {
                for (int i = 0; i < arrTemp.Count; i++)
                {
                    DataRow   dr = null;
                    DataTable dt = new DataTable();
                    dt = ((DataTable)lnkList[arrTemp[i].ToString()]).Clone();
                    if (dt.Columns.Count > 3)
                    {
                        string sTempColumnName = dt.Columns[3].ColumnName;
                        for (int j = 0; j < this.dtDataSource.Rows.Count; j++)
                        {
                            for (int k = 0; k < this.dtDataSource.Columns.Count; k++)
                            {
                                if (this.dtDataSource.Columns[k].ColumnName.Split('^')[0] == sTempColumnName)
                                {
                                    if (this.dtDataSource.Rows[j][k] != null && this.dtDataSource.Rows[j][k].ToString().Length > 0)
                                    {
                                        dr    = dt.NewRow();
                                        dr[0] = dtDataSource.Rows[j][CommonChart.COLUMN_NAME_SEQ_INDEX];
                                        dr[1] = dtDataSource.Rows[j]["TIME"];
                                        dr[2] = dtDataSource.Rows[j][Definition.CHART_COLUMN.TIME2];
                                        dr[3] = dtDataSource.Rows[j][k];
                                        dt.Rows.Add(dr);
                                    }
                                }
                            }
                        }

                        lnkList.Remove(arrTemp[i].ToString());
                        lnkList.Add(arrTemp[i].ToString(), dt);
                    }
                }

                int jcolor = 0;

                for (int i = 0; i < arrTemp.Count; i++)
                {
                    si            = new SeriesInfo(typeof(ExtremeBFastLine), arrTemp[i].ToString(), ((DataTable)lnkList[arrTemp[i].ToString()]), CommonChart.COLUMN_NAME_SEQ_INDEX, arrTemp[i].ToString());
                    si.TreatNulls = TreatNullsStyle.DoNotPaint;

                    si.SeriesColor = chartUtil.GetSeriesColor(jcolor);
                    if (si.SeriesColor == Color.Red || si.SeriesColor == Color.Black)
                    {
                        jcolor++;
                        si.SeriesColor = chartUtil.GetSeriesColor(jcolor);
                    }
                    this.DrawChart(si);
                    jcolor++;
                }
            }
        }