public void Init(IDataCenter dataCenter, string code, double time, KLinePeriod klinePeriod) { this.dataCenter = dataCenter; IDataNavigate dataNavigater = dataCenter.DataNavigateFactory.CreateDataNavigate(code, time); IKLineData klineData = dataNavigater.GetKLineData(klinePeriod); int showKLineIndex = klineData.BarPos; ChartComponentData compData = new ChartComponentData(code, time, klinePeriod, showKLineIndex); this.controller = new ChartComponentController(dataNavigater, compData); this.drawer = new ChartComponentDrawer(this, controller); //this.drawer.GraphicData_Candle.OnGraphicDataChange += GraphicData_Candle_OnGraphicDataChange; this.drawer.GraphicDrawer.AfterGraphicPaint += GraphicDrawer_AfterGraphicPaint; }
public ChartComponentStrategyDrawer(ChartComponentDrawer compChart, Dictionary <KLinePeriod, int> startPos_KLine, int startPos_TimeLine, int startPos_Tick) { this.compChart = compChart; this.startPos_TimeLine = startPos_TimeLine; this.startPos_Tick = startPos_Tick; }