示例#1
0
 public ChartService(IChart chart)
 {
     Chart                    = chart;
     ScaleHorizontal          = new ScaleHorizontal();
     ScaleVertical            = new ScaleVertical();
     HorizontalLinePrice      = new HorizontalLinePrice();
     AdditionalHorizontalLine = new AdditionalHorizontalLine();
 }
示例#2
0
        public void ChartBuild(IEnumerable <IElementChart> candles, string pair, double heightPanel, double widthPanel, double currentPrice, int digits)
        {
            GetMaxAllChart(candles);
            GetMinAllChart(candles);
            GetDeltaAllChart();
            GetScaleIntervalPrice(heightPanel);

            // строим горизонтальную сетку
            ScaleHorizontal.ScaleBuild(heightPanel, widthPanel, MaxAllChart, DeltaAllChart, digits);

            // строим основной график
            Chart.Create(MaxAllChart, ScaleIntervalPrice);

            // строим вертикальную сетку
            ScaleVertical.ScaleBuild(Chart.ElementChartViews, heightPanel, widthPanel);

            // отображение текущей цены
            HorizontalLinePrice.LineCurrentPriceBuild(widthPanel, MaxAllChart, currentPrice, ScaleIntervalPrice);

            var trades = GetTrades(pair, MinAllChart, MaxAllChart);

            AdditionalHorizontalLine.AdditionalLinesBuild(trades, widthPanel, MaxAllChart, ScaleIntervalPrice);
            //------
        }