private void DrawClusterPriceBarBg(/*double price, int amount*/ CCluster clusterData, double y, DateTime dtInterval, double actualWidthClusterGrid) { GenClusterBrushPen(clusterData, dtInterval); //calculate width of cluster bar long dealsAmountFullBar = CUtilConv.GetIntVolume(Math.Max(_dealsAmountFullBar, 1), _decimalVolume);//zero devide protect _volumeRectWidth = (((double)clusterData.AmountTotal) / ((double)dealsAmountFullBar)) * actualWidthClusterGrid; //draw cluster bar with proportional width //DrawRectangle(_brushCluster, _penCluster, new Rect(0.0, y, _volumeRectWidth, (double)_stirngHeight)); _drwCntxtClustersBg.DrawRectangle(_brushCluster, _penCluster, new Rect(0.0, y, _volumeRectWidth, (double)_stirngHeight)); // FormattedText(text, _cultureInfoDefault, FlowDirection.LeftToRight, _typeFaceDefault, _fontSizeScaled, brush); //2018-02-21 string stAmount = CTerminalUtil.GetAmount(clusterData.AmountTotal, _decimalVolume); //print cluster amount //DrawText(_FrmTxtCurrClustAmount, new Point(0.0, y)); //KAA 2017-03-01 changed to Glyph //2018-05-01 changed to fontsizeScaled GlyphRun gr = _glyphGenBg.GetGlyph(0, y + _fontSizeScaled, _fontSizeScaled, " " + /*clusterData.AmountTotal.ToString()*/ stAmount); _drwCntxtClustersBg.DrawGlyphRun(_brushFontBg, gr); }
private void DrawClusterDateBg(CCluster cluster, double actualCanvasWidth) { //double actualWidthClusterGrid = GridCanvasControlClusters.ColumnDefinitions[1].ActualWidth; GenClusterTotalBrushBg(cluster.AmountBuy, cluster.AmountSell); double offsetBottom = 12;//27.0; double y = _actualHeight - _stirngHeight - offsetBottom; //Draw rectangle with summary of period on bottom of screen //DrawRectangle(_brushClusterTotal, _penClusterTotal, new Rect(0.0, y, actualCanvasWidth, (double)_stirngHeight)); _drwCntxtClustersBg.DrawRectangle(_brushClusterTotalBg, _penClusterTotalBg, new Rect(0.0, y, actualCanvasWidth, (double)_stirngHeight)); //2018-07-10 string stAmountTotal = CTerminalUtil.GetAmount(cluster.AmountTotal, _decimalVolume); _FrmTxtCurrClustAmount = GetFormattedTextBg(" " + stAmountTotal); _drwCntxtClustersBg.DrawText(_FrmTxtCurrClustAmount, new Point(0.0, y)); }