Esempio n. 1
0
        public Was_Diff_DataForUI GetWasDiffDataForUI()
        {
            Was_Diff_DataForUI destData = new Was_Diff_DataForUI();
            destData.OptionCode = this.WatchElementList.OptionWE.Code;
            destData.OptionPrice = this.WatchElementList.OptionWE.RefRMD.CurPrice;

            List<Was_Diff_DatumForUI> l = new List<Was_Diff_DatumForUI>();

            foreach (WasEoDiffDatum sourceDatum in _data.Values)
            {
                ElwInfo ei = ElwUtil.GetElwInfo(sourceDatum.ElwCode);

                Was_Diff_DatumForUI destDatum = new Was_Diff_DatumForUI();
                destDatum.ElwCode = sourceDatum.ElwCode;
                destDatum.ElwName = ei.Name;
                destDatum.CurDiff = sourceDatum.CurDiff;
                destDatum.LocalMax = sourceDatum.LocalMax;
                destDatum.LocalMin = sourceDatum.LocalMin;
                destDatum.Max = sourceDatum.Max;
                destDatum.Min = sourceDatum.Min;

                l.Add(destDatum);
            }

            destData.DataList = l;

            return destData;
        }
Esempio n. 2
0
        void DrawDiffData(Was_Diff_DataForUI data)
        {
            chart1.Series["Series1"].Points.Clear();

            foreach (Was_Diff_DatumForUI datum in data.DataList)
            {
                chart1.Series["Series1"].Points.AddXY(datum.ElwName.Substring(0, 2), datum.CurDiff);
            }

            chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;
            chart1.ChartAreas["ChartArea1"].AxisX.IsLabelAutoFit = true;
            chart1.ChartAreas["ChartArea1"].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont | LabelAutoFitStyles.IncreaseFont | LabelAutoFitStyles.WordWrap;

            textBox2.Text = String.Format("{0} curPrice is {1:n2}", data.OptionCode, data.OptionPrice);
        }