From 7d8d7de77928e5a515c678989c06dd6ad5a5d287 Mon Sep 17 00:00:00 2001 From: jwlee Date: Mon, 20 Mar 2023 19:28:11 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EC=B0=A8=ED=8A=B8=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=A4=91~~~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HunterSubForm/ResultViewerForm.cs | 13 +- Million Prototype/Form1.Designer.cs | 147 +++++++++++++++- Million Prototype/Form1.cs | 13 +- Million/SubForm/ChartViewerForm.Designer.cs | 30 ++-- Million/SubForm/ChartViewerForm.cs | 22 ++- Million/SubForm/ChartViewerUI.Designer.cs | 166 ++++-------------- Million/SubForm/ChartViewerUI.cs | 112 +++++++++--- 7 files changed, 316 insertions(+), 187 deletions(-) diff --git a/Million Hunter/HunterSubForm/ResultViewerForm.cs b/Million Hunter/HunterSubForm/ResultViewerForm.cs index 724bff1..6f20349 100644 --- a/Million Hunter/HunterSubForm/ResultViewerForm.cs +++ b/Million Hunter/HunterSubForm/ResultViewerForm.cs @@ -13,6 +13,8 @@ using Million.FileDBManagement; using Million.Data; using DevExpress.XtraTreeList; using Million.DbManagement; +using Million.IndicatorConditionSetup; +using Million.Manager; namespace Million.HunterSubForm { @@ -187,7 +189,16 @@ namespace Million.HunterSubForm var selectedAnalysisData = (AnalysisData)treeList.GetDataRecordByNode(hitInfo.Node); - Million.SubForm.ChartViewerForm chartViewerForm = new Million.SubForm.ChartViewerForm(selectedAnalysisData); + + var buyIndicatorList = IndicatorSetupManager.InitDataSetup(_savedResultData.BuySetupList); + var sellIndicatorList = IndicatorSetupManager.InitDataSetup(_savedResultData.SellSetupList); + + var totalIndicator = new List(); + totalIndicator.AddRange(buyIndicatorList); + totalIndicator.AddRange(sellIndicatorList); + + Million.SubForm.ChartViewerForm chartViewerForm = new Million.SubForm.ChartViewerForm(selectedAnalysisData, + totalIndicator); chartViewerForm.Visible = true; } diff --git a/Million Prototype/Form1.Designer.cs b/Million Prototype/Form1.Designer.cs index ac0571b..dc6a9ef 100644 --- a/Million Prototype/Form1.Designer.cs +++ b/Million Prototype/Form1.Designer.cs @@ -31,6 +31,85 @@ DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram(); DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series(); DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView(); + DevExpress.XtraCharts.XYDiagram xyDiagram2 = new DevExpress.XtraCharts.XYDiagram(); + DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series(); + DevExpress.XtraCharts.StockSeriesLabel stockSeriesLabel1 = new DevExpress.XtraCharts.StockSeriesLabel(); + DevExpress.XtraCharts.SeriesPoint seriesPoint1 = new DevExpress.XtraCharts.SeriesPoint(1D, new object[] { + ((object)(1D)), + ((object)(4D)), + ((object)(3D)), + ((object)(2D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint2 = new DevExpress.XtraCharts.SeriesPoint(2D, new object[] { + ((object)(0D)), + ((object)(5D)), + ((object)(0D)), + ((object)(3D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint3 = new DevExpress.XtraCharts.SeriesPoint(3D, new object[] { + ((object)(0D)), + ((object)(4D)), + ((object)(0D)), + ((object)(2D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint4 = new DevExpress.XtraCharts.SeriesPoint(4D, new object[] { + ((object)(0D)), + ((object)(3D)), + ((object)(0D)), + ((object)(2D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint5 = new DevExpress.XtraCharts.SeriesPoint(5D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(2D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint6 = new DevExpress.XtraCharts.SeriesPoint(6D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(3D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint7 = new DevExpress.XtraCharts.SeriesPoint(7D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(4D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint8 = new DevExpress.XtraCharts.SeriesPoint(8D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(5D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint9 = new DevExpress.XtraCharts.SeriesPoint(9D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(6D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint10 = new DevExpress.XtraCharts.SeriesPoint(10D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(1D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint11 = new DevExpress.XtraCharts.SeriesPoint(11D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(0D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint12 = new DevExpress.XtraCharts.SeriesPoint(12D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(0D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint13 = new DevExpress.XtraCharts.SeriesPoint(13D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(0D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint14 = new DevExpress.XtraCharts.SeriesPoint(14D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(0D))}); + DevExpress.XtraCharts.SeriesPoint seriesPoint15 = new DevExpress.XtraCharts.SeriesPoint(15D, new object[] { + ((object)(0D)), + ((object)(0D)), + ((object)(0D)), + ((object)(0D))}); + DevExpress.XtraCharts.CandleStickSeriesView candleStickSeriesView1 = new DevExpress.XtraCharts.CandleStickSeriesView(); this.label1 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.listBox1 = new System.Windows.Forms.ListBox(); @@ -47,10 +126,16 @@ this.chartControl1 = new DevExpress.XtraCharts.ChartControl(); this.button10 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); + this.chartControl_Candle = new DevExpress.XtraCharts.ChartControl(); ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.chartControl_Candle)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(xyDiagram2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(series2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(stockSeriesLabel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).BeginInit(); this.SuspendLayout(); // // label1 @@ -80,7 +165,7 @@ " "}); this.listBox1.Location = new System.Drawing.Point(166, 18); this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(419, 556); + this.listBox1.Size = new System.Drawing.Size(242, 556); this.listBox1.TabIndex = 2; // // button2 @@ -115,21 +200,21 @@ // // textBoxAskInput // - this.textBoxAskInput.Location = new System.Drawing.Point(608, 18); + this.textBoxAskInput.Location = new System.Drawing.Point(432, 18); this.textBoxAskInput.Name = "textBoxAskInput"; this.textBoxAskInput.Size = new System.Drawing.Size(100, 21); this.textBoxAskInput.TabIndex = 6; // // textBoxAskOutput // - this.textBoxAskOutput.Location = new System.Drawing.Point(714, 18); + this.textBoxAskOutput.Location = new System.Drawing.Point(538, 18); this.textBoxAskOutput.Name = "textBoxAskOutput"; this.textBoxAskOutput.Size = new System.Drawing.Size(100, 21); this.textBoxAskOutput.TabIndex = 7; // // button5 // - this.button5.Location = new System.Drawing.Point(608, 45); + this.button5.Location = new System.Drawing.Point(432, 45); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 8; @@ -183,7 +268,7 @@ xyDiagram1.AxisY.VisibleInPanesSerializable = ""; this.chartControl1.Diagram = xyDiagram1; this.chartControl1.Legend.Name = "Default Legend"; - this.chartControl1.Location = new System.Drawing.Point(608, 79); + this.chartControl1.Location = new System.Drawing.Point(432, 79); this.chartControl1.Name = "chartControl1"; series1.Name = "Series 1"; series1.View = lineSeriesView1; @@ -194,7 +279,7 @@ // // button10 // - this.button10.Location = new System.Drawing.Point(608, 285); + this.button10.Location = new System.Drawing.Point(432, 285); this.button10.Name = "button10"; this.button10.Size = new System.Drawing.Size(75, 23); this.button10.TabIndex = 14; @@ -212,11 +297,53 @@ this.button11.UseVisualStyleBackColor = true; this.button11.Click += new System.EventHandler(this.button11_Click); // + // chartControl_Candle + // + this.chartControl_Candle.CrosshairOptions.ShowOutOfRangePoints = true; + xyDiagram2.AxisX.VisibleInPanesSerializable = ""; + xyDiagram2.AxisY.VisibleInPanesSerializable = ""; + this.chartControl_Candle.Diagram = xyDiagram2; + this.chartControl_Candle.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Empty; + this.chartControl_Candle.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.CheckBoxAndMarker; + this.chartControl_Candle.Legend.Name = "Default Legend"; + this.chartControl_Candle.Location = new System.Drawing.Point(293, 306); + this.chartControl_Candle.Name = "chartControl_Candle"; + stockSeriesLabel1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True; + stockSeriesLabel1.ResolveOverlappingMode = DevExpress.XtraCharts.ResolveOverlappingMode.HideOverlapped; + series2.Label = stockSeriesLabel1; + series2.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; + series2.Name = "Series 1"; + seriesPoint1.ColorSerializable = "#FF80FF"; + series2.Points.AddRange(new DevExpress.XtraCharts.SeriesPoint[] { + seriesPoint1, + seriesPoint2, + seriesPoint3, + seriesPoint4, + seriesPoint5, + seriesPoint6, + seriesPoint7, + seriesPoint8, + seriesPoint9, + seriesPoint10, + seriesPoint11, + seriesPoint12, + seriesPoint13, + seriesPoint14, + seriesPoint15}); + candleStickSeriesView1.ReductionOptions.ColorMode = DevExpress.XtraCharts.ReductionColorMode.OpenToCloseValue; + candleStickSeriesView1.ReductionOptions.FillMode = DevExpress.XtraCharts.CandleStickFillMode.AlwaysEmpty; + series2.View = candleStickSeriesView1; + this.chartControl_Candle.SeriesSerializable = new DevExpress.XtraCharts.Series[] { + series2}; + this.chartControl_Candle.Size = new System.Drawing.Size(829, 343); + this.chartControl_Candle.TabIndex = 16; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1415, 703); + this.ClientSize = new System.Drawing.Size(1415, 952); + this.Controls.Add(this.chartControl_Candle); this.Controls.Add(this.button11); this.Controls.Add(this.button10); this.Controls.Add(this.chartControl1); @@ -239,6 +366,11 @@ ((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(series1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(xyDiagram2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(stockSeriesLabel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(series2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.chartControl_Candle)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -262,6 +394,7 @@ private DevExpress.XtraCharts.ChartControl chartControl1; private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button11; + public DevExpress.XtraCharts.ChartControl chartControl_Candle; } } diff --git a/Million Prototype/Form1.cs b/Million Prototype/Form1.cs index 4c423d1..fceacc8 100644 --- a/Million Prototype/Form1.cs +++ b/Million Prototype/Form1.cs @@ -31,6 +31,7 @@ namespace Million_Prototype { InitializeComponent(); + /* var startDate = new DateTime(2022, 1, 1, 0, 0, 0); var endDate = new DateTime(2022, 1, 2, 0, 0, 0); @@ -40,10 +41,18 @@ namespace Million_Prototype var datas = IndicatorSetupManager.GetCalculateCandleData(new List(), startDate, endDate, market); ChartViewerForm chartViewerForm = new ChartViewerForm(null); - chartViewerForm.setting(datas[MCandleTimeType.M1]); - + //chartViewerForm.setting(datas[MCandleTimeType.M1]); + chartViewerForm.Show(); + */ + var xyDiagram = (XYDiagram)chartControl_Candle.Diagram; + xyDiagram.EnableAxisXZooming = true; + //xyDiagram.EnableAxisYZooming = true; + xyDiagram.ZoomingOptions.UseKeyboard = true; + xyDiagram.ZoomingOptions.UseKeyboardWithMouse = true; + xyDiagram.ZoomingOptions.UseMouseWheel = true; + xyDiagram.ZoomingOptions.UseTouchDevice = true; } diff --git a/Million/SubForm/ChartViewerForm.Designer.cs b/Million/SubForm/ChartViewerForm.Designer.cs index fde4e00..85157e5 100644 --- a/Million/SubForm/ChartViewerForm.Designer.cs +++ b/Million/SubForm/ChartViewerForm.Designer.cs @@ -58,7 +58,7 @@ this.panel_ChartViewer.Dock = System.Windows.Forms.DockStyle.Fill; this.panel_ChartViewer.Location = new System.Drawing.Point(0, 80); this.panel_ChartViewer.Name = "panel_ChartViewer"; - this.panel_ChartViewer.Size = new System.Drawing.Size(756, 540); + this.panel_ChartViewer.Size = new System.Drawing.Size(829, 626); this.panel_ChartViewer.TabIndex = 1; // // comboBoxEdit_Hour @@ -74,7 +74,7 @@ // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(532, 15); + this.label1.Location = new System.Drawing.Point(605, 15); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(69, 14); this.label1.TabIndex = 1; @@ -83,7 +83,7 @@ // comboBoxEdit_CandleDateTime // this.comboBoxEdit_CandleDateTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxEdit_CandleDateTime.Location = new System.Drawing.Point(603, 12); + this.comboBoxEdit_CandleDateTime.Location = new System.Drawing.Point(676, 12); this.comboBoxEdit_CandleDateTime.Name = "comboBoxEdit_CandleDateTime"; this.comboBoxEdit_CandleDateTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); @@ -94,7 +94,7 @@ // this.dateEdit_DateTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.dateEdit_DateTime.EditValue = null; - this.dateEdit_DateTime.Location = new System.Drawing.Point(695, 12); + this.dateEdit_DateTime.Location = new System.Drawing.Point(768, 12); this.dateEdit_DateTime.Name = "dateEdit_DateTime"; this.dateEdit_DateTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); @@ -112,7 +112,7 @@ // comboBoxEdit_ExchangePlace // this.comboBoxEdit_ExchangePlace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxEdit_ExchangePlace.Location = new System.Drawing.Point(68, 12); + this.comboBoxEdit_ExchangePlace.Location = new System.Drawing.Point(141, 12); this.comboBoxEdit_ExchangePlace.Name = "comboBoxEdit_ExchangePlace"; this.comboBoxEdit_ExchangePlace.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); @@ -123,7 +123,7 @@ // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(16, 15); + this.label3.Location = new System.Drawing.Point(89, 15); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(49, 14); this.label3.TabIndex = 4; @@ -132,7 +132,7 @@ // comboBoxEdit_PaymentType // this.comboBoxEdit_PaymentType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxEdit_PaymentType.Location = new System.Drawing.Point(241, 12); + this.comboBoxEdit_PaymentType.Location = new System.Drawing.Point(314, 12); this.comboBoxEdit_PaymentType.Name = "comboBoxEdit_PaymentType"; this.comboBoxEdit_PaymentType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); @@ -143,7 +143,7 @@ // this.label_종목타입.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label_종목타입.AutoSize = true; - this.label_종목타입.Location = new System.Drawing.Point(175, 15); + this.label_종목타입.Location = new System.Drawing.Point(248, 15); this.label_종목타입.Name = "label_종목타입"; this.label_종목타입.Size = new System.Drawing.Size(63, 14); this.label_종목타입.TabIndex = 10; @@ -152,7 +152,7 @@ // comboBoxEdit_MarketInfo // this.comboBoxEdit_MarketInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxEdit_MarketInfo.Location = new System.Drawing.Point(397, 12); + this.comboBoxEdit_MarketInfo.Location = new System.Drawing.Point(470, 12); this.comboBoxEdit_MarketInfo.Name = "comboBoxEdit_MarketInfo"; this.comboBoxEdit_MarketInfo.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); @@ -163,7 +163,7 @@ // this.label_종목이름.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label_종목이름.AutoSize = true; - this.label_종목이름.Location = new System.Drawing.Point(332, 14); + this.label_종목이름.Location = new System.Drawing.Point(405, 14); this.label_종목이름.Name = "label_종목이름"; this.label_종목이름.Size = new System.Drawing.Size(63, 14); this.label_종목이름.TabIndex = 12; @@ -172,7 +172,7 @@ // simpleButton_IndicatorSetup // this.simpleButton_IndicatorSetup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.simpleButton_IndicatorSetup.Location = new System.Drawing.Point(744, 46); + this.simpleButton_IndicatorSetup.Location = new System.Drawing.Point(817, 46); this.simpleButton_IndicatorSetup.Name = "simpleButton_IndicatorSetup"; this.simpleButton_IndicatorSetup.Size = new System.Drawing.Size(130, 29); this.simpleButton_IndicatorSetup.TabIndex = 13; @@ -195,22 +195,22 @@ this.panelControl_menu.Dock = System.Windows.Forms.DockStyle.Top; this.panelControl_menu.Location = new System.Drawing.Point(0, 0); this.panelControl_menu.Name = "panelControl_menu"; - this.panelControl_menu.Size = new System.Drawing.Size(886, 80); + this.panelControl_menu.Size = new System.Drawing.Size(959, 80); this.panelControl_menu.TabIndex = 0; // // panel1 // this.panel1.Dock = System.Windows.Forms.DockStyle.Right; - this.panel1.Location = new System.Drawing.Point(756, 80); + this.panel1.Location = new System.Drawing.Point(829, 80); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(130, 540); + this.panel1.Size = new System.Drawing.Size(130, 626); this.panel1.TabIndex = 2; // // ChartViewerForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(886, 620); + this.ClientSize = new System.Drawing.Size(959, 706); this.Controls.Add(this.panel_ChartViewer); this.Controls.Add(this.panel1); this.Controls.Add(this.panelControl_menu); diff --git a/Million/SubForm/ChartViewerForm.cs b/Million/SubForm/ChartViewerForm.cs index c5862d4..5c215c9 100644 --- a/Million/SubForm/ChartViewerForm.cs +++ b/Million/SubForm/ChartViewerForm.cs @@ -11,6 +11,7 @@ using DevExpress.DataAccess.Native.ExpressionEditor; using DevExpress.XtraEditors; using Million.WebServices; using Million.Data; +using Million.IndicatorConditionSetup; namespace Million.SubForm { @@ -21,12 +22,14 @@ namespace Million.SubForm { ChartViewerUI chartViewerUi = null; AnalysisData _selectedAnalysisData = null; + List _indicatorCoditionSetups = null; - public ChartViewerForm(AnalysisData selectedAnalysisData) + public ChartViewerForm(AnalysisData selectedAnalysisData, List indicatorList = null) { InitializeComponent(); _selectedAnalysisData = selectedAnalysisData; + _indicatorCoditionSetups = indicatorList; // 초기 설정 InitForm(); @@ -42,26 +45,27 @@ namespace Million.SubForm // Million으로부터 거래소 정보 가져오기 var exchangePlaceNames = Enum.GetNames(enumType: typeof(Million.CommonProperty.ExchangePlace)); comboBoxEdit_ExchangePlace.Properties.Items.AddRange(exchangePlaceNames); - comboBoxEdit_ExchangePlace.SelectedIndex = 0; + comboBoxEdit_ExchangePlace.SelectedItem = _selectedAnalysisData.ExchangePlace; // 종목 타입 설정 comboBoxEdit_PaymentType.Properties.Items.AddRange(Enum.GetNames(enumType: typeof(Million.CommonProperty.PaymentType))); - comboBoxEdit_PaymentType.SelectedIndex = 0; + comboBoxEdit_PaymentType.SelectedItem = _selectedAnalysisData.CoinFullName.Split('-').First(); // 시간 단위 가져오기 var candleTimeTypeList = Enum.GetNames(enumType: typeof(CommonProperty.MCandleTimeType)); comboBoxEdit_CandleDateTime.Properties.Items.AddRange(candleTimeTypeList); + // 시간 단위 설정 (AnalysisData에 추가하기) comboBoxEdit_CandleDateTime.SelectedItem = CommonProperty.MCandleTimeType.H1.ToString(); // 기간 설정 (Default) : 현재 시간 - dateEdit_DateTime.DateTime = DateTime.Now; + dateEdit_DateTime.DateTime = _selectedAnalysisData.StartDate; - //comboBoxEdit_MarketInfo.Properties.Items.AddRange(CommonProperty.selectedMarketOfPlaceList.Select(t => t.KorName).ToList()); + // 종목 리스트 가져오기 + comboBoxEdit_MarketInfo.Properties.Items.AddRange(CommonProperty.selectedMarketOfPlaceList.Select(t => t.KorName).ToList()); + // 종목 선택 + comboBoxEdit_MarketInfo.SelectedItem = _selectedAnalysisData.KorName; - //// DB 서버 정보 생성 - //var strConn = Million.CommonProperty.DbConnectionStr + comboBoxEdit_ExchangePlace.EditValue; - - chartViewerUi = new ChartViewerUI(_selectedAnalysisData); + chartViewerUi = new ChartViewerUI(_selectedAnalysisData, _indicatorCoditionSetups); panel_ChartViewer.Controls.Add(chartViewerUi); } diff --git a/Million/SubForm/ChartViewerUI.Designer.cs b/Million/SubForm/ChartViewerUI.Designer.cs index 4142431..3b076e4 100644 --- a/Million/SubForm/ChartViewerUI.Designer.cs +++ b/Million/SubForm/ChartViewerUI.Designer.cs @@ -28,164 +28,79 @@ /// private void InitializeComponent() { - DevExpress.XtraEditors.RangeControlRange rangeControlRange1 = new DevExpress.XtraEditors.RangeControlRange(); DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram(); DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series(); - DevExpress.XtraCharts.SeriesPoint seriesPoint1 = new DevExpress.XtraCharts.SeriesPoint("21-03-19 00:00", new object[] { - ((object)(1395D)), - ((object)(1436D)), - ((object)(1435D)), - ((object)(1422D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint2 = new DevExpress.XtraCharts.SeriesPoint("01:00", new object[] { - ((object)(1380D)), - ((object)(1443D)), - ((object)(1423D)), - ((object)(1385D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint3 = new DevExpress.XtraCharts.SeriesPoint("3", new object[] { - ((object)(1382D)), - ((object)(1439D)), - ((object)(1383D)), - ((object)(1433D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint4 = new DevExpress.XtraCharts.SeriesPoint("4", new object[] { - ((object)(1406D)), - ((object)(1437D)), - ((object)(1433D)), - ((object)(1414D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint5 = new DevExpress.XtraCharts.SeriesPoint("5", new object[] { - ((object)(1414D)), - ((object)(1456D)), - ((object)(1414D)), - ((object)(1450D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint6 = new DevExpress.XtraCharts.SeriesPoint("6", new object[] { - ((object)(1391D)), - ((object)(1452D)), - ((object)(1450D)), - ((object)(1415D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint7 = new DevExpress.XtraCharts.SeriesPoint("7", new object[] { - ((object)(1405D)), - ((object)(1440D)), - ((object)(1417D)), - ((object)(1423D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint8 = new DevExpress.XtraCharts.SeriesPoint("8", new object[] { - ((object)(1410D)), - ((object)(1428D)), - ((object)(1423D)), - ((object)(1424D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint9 = new DevExpress.XtraCharts.SeriesPoint("9", new object[] { - ((object)(1402D)), - ((object)(1427D)), - ((object)(1424D)), - ((object)(1404D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint10 = new DevExpress.XtraCharts.SeriesPoint("10", new object[] { - ((object)(1403D)), - ((object)(1426D)), - ((object)(1405D)), - ((object)(1415D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint11 = new DevExpress.XtraCharts.SeriesPoint("11", new object[] { - ((object)(1409D)), - ((object)(1438D)), - ((object)(1414D)), - ((object)(1438D))}); - DevExpress.XtraCharts.SeriesPoint seriesPoint12 = new DevExpress.XtraCharts.SeriesPoint("12", new object[] { - ((object)(1429D)), - ((object)(1500D)), - ((object)(1438D)), - ((object)(1492D))}); DevExpress.XtraCharts.CandleStickSeriesView candleStickSeriesView1 = new DevExpress.XtraCharts.CandleStickSeriesView(); - DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series(); - DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView(); - DevExpress.XtraCharts.SideBySideBarSeriesView sideBySideBarSeriesView1 = new DevExpress.XtraCharts.SideBySideBarSeriesView(); DevExpress.XtraCharts.XYDiagram xyDiagram2 = new DevExpress.XtraCharts.XYDiagram(); - DevExpress.XtraCharts.Series series3 = new DevExpress.XtraCharts.Series(); - this.rangeControl1 = new DevExpress.XtraEditors.RangeControl(); + DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series(); this.chartControl_Candle = new DevExpress.XtraCharts.ChartControl(); this.splitterControl1 = new DevExpress.XtraEditors.SplitterControl(); this.splitContainerControl_CharViewer = new DevExpress.XtraEditors.SplitContainerControl(); this.chartControl_Bar = new DevExpress.XtraCharts.ChartControl(); - ((System.ComponentModel.ISupportInitialize)(this.rangeControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartControl_Candle)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(series2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl_CharViewer)).BeginInit(); this.splitContainerControl_CharViewer.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.chartControl_Bar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(xyDiagram2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(series3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(series2)).BeginInit(); this.SuspendLayout(); // - // rangeControl1 - // - this.rangeControl1.Client = this.chartControl_Candle; - this.rangeControl1.Location = new System.Drawing.Point(11, 568); - this.rangeControl1.Name = "rangeControl1"; - rangeControlRange1.Maximum = "9"; - rangeControlRange1.Minimum = "3"; - rangeControlRange1.Owner = this.rangeControl1; - this.rangeControl1.SelectedRange = rangeControlRange1; - this.rangeControl1.SelectionType = DevExpress.XtraEditors.RangeControlSelectionType.ThumbAndFlag; - this.rangeControl1.Size = new System.Drawing.Size(420, 105); - this.rangeControl1.TabIndex = 6; - this.rangeControl1.Text = "rangeControl1"; - // // chartControl_Candle // this.chartControl_Candle.CrosshairOptions.ShowOutOfRangePoints = true; - xyDiagram1.AxisX.AutoScaleBreaks.Enabled = true; - xyDiagram1.AxisX.AutoScaleBreaks.MaxCount = 6; xyDiagram1.AxisX.GridLines.MinorVisible = true; xyDiagram1.AxisX.GridLines.Visible = true; - xyDiagram1.AxisX.Interlaced = true; - xyDiagram1.AxisX.Label.TextPattern = "{yy-MM-dd h:mm}"; + xyDiagram1.AxisX.Visibility = DevExpress.Utils.DefaultBoolean.True; xyDiagram1.AxisX.VisibleInPanesSerializable = ""; - xyDiagram1.AxisX.VisualRange.Auto = false; - xyDiagram1.AxisX.VisualRange.MaxValueSerializable = "9"; - xyDiagram1.AxisX.VisualRange.MinValueSerializable = "3"; xyDiagram1.AxisY.VisibleInPanesSerializable = ""; - xyDiagram1.AxisY.WholeRange.AlwaysShowZeroLevel = false; + xyDiagram1.DefaultPane.EnableAxisXZooming = DevExpress.Utils.DefaultBoolean.True; + xyDiagram1.DefaultPane.EnableAxisYZooming = DevExpress.Utils.DefaultBoolean.True; + xyDiagram1.EnableAxisXScrolling = true; + xyDiagram1.EnableAxisXZooming = true; + xyDiagram1.EnableAxisYScrolling = true; + xyDiagram1.EnableAxisYZooming = true; this.chartControl_Candle.Diagram = xyDiagram1; + this.chartControl_Candle.Dock = System.Windows.Forms.DockStyle.Fill; this.chartControl_Candle.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Empty; + this.chartControl_Candle.Legend.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.chartControl_Candle.Legend.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Hatch; + this.chartControl_Candle.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.CheckBoxAndMarker; + this.chartControl_Candle.Legend.MarkerSize = new System.Drawing.Size(20, 18); this.chartControl_Candle.Legend.Name = "Default Legend"; + this.chartControl_Candle.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True; this.chartControl_Candle.Location = new System.Drawing.Point(0, 0); this.chartControl_Candle.Name = "chartControl_Candle"; + series1.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.DateTime; + series1.CrosshairContentShowMode = DevExpress.XtraCharts.CrosshairContentShowMode.Label; + series1.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True; + series1.LegendName = "Default Legend"; series1.Name = "Series 1"; - series1.Points.AddRange(new DevExpress.XtraCharts.SeriesPoint[] { - seriesPoint1, - seriesPoint2, - seriesPoint3, - seriesPoint4, - seriesPoint5, - seriesPoint6, - seriesPoint7, - seriesPoint8, - seriesPoint9, - seriesPoint10, - seriesPoint11, - seriesPoint12}); + candleStickSeriesView1.LineThickness = 1; + candleStickSeriesView1.RangeControlOptions.ValueLevel = DevExpress.XtraCharts.ValueLevel.Close; + candleStickSeriesView1.RangeControlOptions.ViewType = DevExpress.XtraCharts.RangeControlViewType.Area; + candleStickSeriesView1.ReductionOptions.ColorMode = DevExpress.XtraCharts.ReductionColorMode.OpenToCloseValue; series1.View = candleStickSeriesView1; - series2.Name = "Series 2"; - series2.View = lineSeriesView1; this.chartControl_Candle.SeriesSerializable = new DevExpress.XtraCharts.Series[] { - series1, - series2}; - sideBySideBarSeriesView1.RangeControlOptions.ViewType = DevExpress.XtraCharts.RangeControlViewType.Area; - this.chartControl_Candle.SeriesTemplate.View = sideBySideBarSeriesView1; - this.chartControl_Candle.Size = new System.Drawing.Size(829, 343); + series1}; + this.chartControl_Candle.Size = new System.Drawing.Size(992, 294); this.chartControl_Candle.TabIndex = 3; + this.chartControl_Candle.Scroll += new DevExpress.XtraCharts.ChartScrollEventHandler(this.chartControl_Candle_Scroll); + this.chartControl_Candle.AxisWholeRangeChanged += new System.EventHandler(this.chartControl_Candle_AxisWholeRangeChanged); // // splitterControl1 // this.splitterControl1.Location = new System.Drawing.Point(0, 0); this.splitterControl1.Name = "splitterControl1"; - this.splitterControl1.Size = new System.Drawing.Size(5, 807); + this.splitterControl1.Size = new System.Drawing.Size(5, 692); this.splitterControl1.TabIndex = 4; this.splitterControl1.TabStop = false; // // splitContainerControl_CharViewer // + this.splitContainerControl_CharViewer.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainerControl_CharViewer.Horizontal = false; this.splitContainerControl_CharViewer.InvertTouchScroll = true; this.splitContainerControl_CharViewer.Location = new System.Drawing.Point(5, 0); @@ -194,8 +109,8 @@ this.splitContainerControl_CharViewer.Panel1.Text = "Panel1"; this.splitContainerControl_CharViewer.Panel2.Controls.Add(this.chartControl_Bar); this.splitContainerControl_CharViewer.Panel2.Text = "Panel2"; - this.splitContainerControl_CharViewer.Size = new System.Drawing.Size(829, 517); - this.splitContainerControl_CharViewer.SplitterPosition = 343; + this.splitContainerControl_CharViewer.Size = new System.Drawing.Size(992, 692); + this.splitContainerControl_CharViewer.SplitterPosition = 294; this.splitContainerControl_CharViewer.TabIndex = 5; // // chartControl_Bar @@ -208,37 +123,33 @@ xyDiagram2.AxisY.VisibleInPanesSerializable = ""; xyDiagram2.AxisY.WholeRange.AlwaysShowZeroLevel = false; this.chartControl_Bar.Diagram = xyDiagram2; + this.chartControl_Bar.Dock = System.Windows.Forms.DockStyle.Fill; this.chartControl_Bar.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Empty; this.chartControl_Bar.Legend.Name = "Default Legend"; this.chartControl_Bar.Location = new System.Drawing.Point(0, 0); this.chartControl_Bar.Name = "chartControl_Bar"; - series3.Name = "Series 1"; + series2.Name = "Series 1"; this.chartControl_Bar.SeriesSerializable = new DevExpress.XtraCharts.Series[] { - series3}; - this.chartControl_Bar.Size = new System.Drawing.Size(829, 169); + series2}; + this.chartControl_Bar.Size = new System.Drawing.Size(992, 393); this.chartControl_Bar.TabIndex = 4; // // ChartViewerUI // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.rangeControl1); this.Controls.Add(this.splitContainerControl_CharViewer); this.Controls.Add(this.splitterControl1); this.Name = "ChartViewerUI"; - this.Size = new System.Drawing.Size(997, 807); - ((System.ComponentModel.ISupportInitialize)(this.rangeControl1)).EndInit(); + this.Size = new System.Drawing.Size(997, 692); ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(series1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(series2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartControl_Candle)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl_CharViewer)).EndInit(); this.splitContainerControl_CharViewer.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(xyDiagram2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(series3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(series2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartControl_Bar)).EndInit(); this.ResumeLayout(false); @@ -250,6 +161,5 @@ private DevExpress.XtraEditors.SplitContainerControl splitContainerControl_CharViewer; public DevExpress.XtraCharts.ChartControl chartControl_Candle; public DevExpress.XtraCharts.ChartControl chartControl_Bar; - private DevExpress.XtraEditors.RangeControl rangeControl1; } } diff --git a/Million/SubForm/ChartViewerUI.cs b/Million/SubForm/ChartViewerUI.cs index 1a973c1..4f56e5f 100644 --- a/Million/SubForm/ChartViewerUI.cs +++ b/Million/SubForm/ChartViewerUI.cs @@ -11,26 +11,85 @@ using DevExpress.XtraEditors; using Million.Data; using Million.IndicatorConditionSetup; using DevExpress.XtraCharts; +using Million.Manager; namespace Million.SubForm { /// /// 차트 뷰어 UI /// - public partial class ChartViewerUI : DevExpress.XtraEditors.XtraUserControl + public partial class ChartViewerUI : System.Windows.Forms.UserControl { List datas = null; - List setupList = null; + List _setupList = null; AnalysisData _analysisData = null; - public ChartViewerUI(AnalysisData analysisData) + public ChartViewerUI(AnalysisData analysisData, List indicatorCoditionSetups) { InitializeComponent(); _analysisData = analysisData; + _setupList = indicatorCoditionSetups; + + // Start DateTime + 99 시간 = EndDate Time + // 추후 시간 Interval에 따라서 분리하기 + var chartEndDate = analysisData.StartDate + new TimeSpan(0, 99, 0, 0); + + var dic = DataManager.GetStandardData(indicatorCoditionSetups, analysisData.StartDate, chartEndDate, analysisData.OriginalSearchResult.MarketData + , indicatorCoditionSetups, true); + + var datas = IndicatorSetupManager.CalculateIndicator(dic, _setupList, analysisData.StartDate, chartEndDate, analysisData.CoinFullName, false); + + InitSet(datas[CommonProperty.MCandleTimeType.H1], indicatorCoditionSetups); + + // Chart Rnage 설정하기 + var diagram = (XYDiagram)chartControl_Candle.Diagram; + + + + #region Chart Range 설정하기 + + + //추후 1시간, 1일 등 간격 수정 필요 + var setTimeInterval = 10; + var viewRangeEndDate = analysisData.StartDate + new TimeSpan(0, setTimeInterval, 0, 0); + + // Define the whole range for the X-axis. + diagram.AxisX.WholeRange.Auto = false; + diagram.AxisX.WholeRange.SetMinMaxValues(analysisData.StartDate, chartEndDate); + + // Disable the side margins + // (this has an effect only for certain view types). + diagram.AxisX.VisualRange.AutoSideMargins = false; + + // Limit the visible range for the X-axis. + diagram.AxisX.VisualRange.Auto = true; + diagram.AxisX.VisualRange.SetMinMaxValues(analysisData.StartDate, viewRangeEndDate); + + // Define the whole range for the Y-axis. + diagram.AxisY.WholeRange.Auto = true; + diagram.AxisY.VisualRange.Auto = true; + //diagram.AxisY.WholeRange.SetMinMaxValues(120, 140); + + //diagram.AxisX.Tickmarks.Visible = true; + diagram.AxisX.LabelVisibilityMode = AxisLabelVisibilityMode.Default; + diagram.AxisX.Label.TextColor = Color.White; + diagram.AxisY.Label.TextColor = Color.White; + diagram.AxisX.Label.TextPattern = "{A:MM-dd HH:mm}"; + diagram.AxisY.Label.TextPattern = "{V}"; + + diagram.EnableAxisXScrolling = true; + diagram.EnableAxisYScrolling = true; + + diagram.ZoomingOptions.UseKeyboard = true; + diagram.ZoomingOptions.UseKeyboardWithMouse = true; + diagram.ZoomingOptions.UseMouseWheel = true; + diagram.ZoomingOptions.UseTouchDevice = true; + #endregion } + /// /// Data Setting /// @@ -38,14 +97,10 @@ namespace Million.SubForm public void InitSet(List datas, List setupList) { this.datas = datas; - this.setupList = setupList; - ResetDraw(); + this._setupList = setupList; + //ResetDraw(); DrawChart(); - SetDiagram(); - - rangeControl1.SelectedRange.Maximum = "9"; - rangeControl1.SelectedRange.Minimum = "1"; - + SetDiagram(); } /// @@ -54,7 +109,15 @@ namespace Million.SubForm /// private void SetDiagram(DateTimeMeasureUnit type = DateTimeMeasureUnit.Minute) { - ((XYDiagram)chartControl_Candle.Diagram).AxisX.DateTimeScaleOptions.MeasureUnit = type; + ((XYDiagram)chartControl_Candle.Diagram).AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Hour; + + // 다이어그램 스크롤링 + ((XYDiagram)chartControl_Candle.Diagram).EnableAxisXScrolling = true; + ((XYDiagram)chartControl_Candle.Diagram).EnableAxisYScrolling = true; + + // X Whole Range + ((XYDiagram)chartControl_Candle.Diagram).AxisX.WholeRange.Auto = true; + //((XYDiagram)chartControl_Candle.Diagram).AxisX.WholeRange.SetMinMaxValues(); } /// @@ -70,24 +133,13 @@ namespace Million.SubForm /// public void DrawChart() { - Series candle = new Series(); - candle.View = new CandleStickSeriesView(); - chartControl_Candle.Series.Add(candle); - candle.ArgumentScaleType = ScaleType.DateTime; + var candle = chartControl_Candle.Series.First(); - // Access the chart's diagram. - XYDiagram diagram = (XYDiagram)chartControl_Candle.Diagram; - - // Exclude empty ranges from the X-axis range - // to avoid gaps in the chart's data. - - - // Hide the range without points at the beginning of the y-axis. - diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false; + candle.ActualPoints.Clear(); foreach (var item in datas) { - candle.Points.Add(new SeriesPoint(item.DateTime, new double[] { item.LowValue, item.HighValue, item.StartValue, item.EndValue })); + candle.ActualPoints.Add(new SeriesPoint(item.DateTime, new double[] { item.LowValue, item.HighValue, item.StartValue, item.EndValue })); } } /// @@ -107,5 +159,15 @@ namespace Million.SubForm line.Points.AddPoint(item.DateTime, item.IndicatorDic[setup.GetKeyName()].overlapValue); } } + + private void chartControl_Candle_AxisWholeRangeChanged(object sender, AxisRangeChangedEventArgs e) + { + + } + + private void chartControl_Candle_Scroll(object sender, ChartScrollEventArgs e) + { + + } } }