private void ShowChartClick(object sender, RoutedEventArgs e) { var security = Security.SelectedSecurity; var series = new CandleSeries(typeof(TimeFrameCandle), security, TimeSpan.FromMinutes(5)); _chartWindows.SafeAdd(series, key => { var wnd = new ChartWindow { Title = "{0} {1}".Put(security.Code, series.Arg) }; wnd.MakeHideable(); var area = new ChartArea(); wnd.Chart.Areas.Add(area); var candlesElem = new ChartCandleElement(); area.Elements.Add(candlesElem); _candleManager.Processing += (s, candle) => wnd.Chart.Draw(candlesElem, candle); return(wnd); }).Show(); _candleManager.Start(series); }
private void ShowChartClick(object sender, RoutedEventArgs e) { var security = Security.SelectedSecurity; var series = new CandleSeries(typeof(TimeFrameCandle), security, TimeSpan.FromMinutes(5)); _chartWindows.SafeAdd(series, key => { var wnd = new ChartWindow { Title = "{0} {1}".Put(security.Code, series.Arg) }; wnd.MakeHideable(); var area = new ChartArea(); wnd.Chart.Areas.Add(area); var candlesElem = new ChartCandleElement(); area.Elements.Add(candlesElem); series.ProcessCandle += candle => wnd.Chart.Draw(candlesElem, candle); return wnd; }).Show(); _candleManager.Start(series); }