function DrawBars
191041
function DrawLegend($which_x1,$which_y1,$which_boxtype) {
    //Base code submitted by Marlin Viss
    $max_legend_length=0;
    reset($this->legend);
    while (list(,$leg) = each($this->legend)) {
      $len = strlen($leg);
      if ($max_legend_length < $len) {
        $max_legend_length = $len;
      }
    }

    $line_spacing = 1.25;
    $vert_margin = $this->small_font_height/2 ;
    $dot_height = $this->small_font_height*$line_spacing - 1;

  //Upper Left
    if ((!$which_x1) || (!$which_y1) ) {
      $box_start_x = $this->plot_area[2] - $this->small_font_width*($max_legend_length+4);
      $box_start_y = $this->plot_area[1] + 4;
    } else {
      $box_start_x = $which_x1;
      $box_start_y = $which_y1;
    }

  //Lower Right
    $box_end_y = $box_start_y + $this->small_font_height*(count($this->legend)+1) + 2*$vert_margin;
    //$box_end_x = $this->plot_area[2] - 5;
    $box_end_x = $box_start_x + $this->small_font_width*($max_legend_length+4) - 5;


  // Draw box for legend
    ImageFilledRectangle($this->img,
      $box_start_x, $box_start_y,$box_end_x,
      $box_end_y, $this->ndx_bg_color);
    ImageRectangle($this->img,
      $box_start_x, $box_start_y,$box_end_x,
      $box_end_y, $this->ndx_grid_color);

    $color_index=0;
    $i = 0;


    reset($this->legend);


    while (list(,$leg) = each($this->legend)) {
      $y_pos = $box_start_y + $this->small_font_height*($i)*($line_spacing) + $vert_margin;

      ImageString($this->img, $this->small_font,
      $box_start_x + $this->small_font_width*( $max_legend_length - strlen($leg) + 1 ) ,
      $y_pos,
      $leg, $this->ndx_text_color);

      if ($color_index >= count($this->ndx_data_color)) $color_index=0;
  // Draw a box in the data color
      ImageFilledRectangle($this->img,
        $box_end_x - $this->small_font_width*2,
        $y_pos + 1, $box_end_x - $this->small_font_width,
        $y_pos + $dot_height,
        $this->ndx_data_color[$color_index]);

      ImageRectangle($this->img,
        $box_end_x - $this->small_font_width*2,
        $y_pos + 1, $box_end_x - $this->small_font_width,
        $y_pos + $dot_height,
        $this->ndx_text_color);
      $i++;
      $color_index++;
    }
  }
161690
function drawGroupedBar() {
            // Not ideal, we need to figure out how to call exit for nested elements
            if (layerElements) {
                svg.selectAll('.layer').remove();
            }

            let series = svg.select('.chart-group').selectAll('.layer');

            animationDelays = d3Array.range(animationDelayStep, (layers.length + 1) * animationDelayStep, animationDelayStep)
            if (isHorizontal) {
                drawHorizontalBars(series);
            } else {
                drawVerticalBars(series);
            }

            // Exit
            series.exit()
                .transition()
                .style('opacity', 0)
                .remove();
        }
1180924
function() {
    var x_start = this.bar_padding + this.options.plot_padding,
        step = this.step;
    if (this.grouped) {
      step = step * this.group_size;
      x_start = ((this.bar_width * this.group_size) + (this.bar_padding * this.group_size)) / 2
      x_start = this.roundValue(x_start, 0);
    }
    this.drawMarkers(this.options.labels, [1, 0], step, x_start, [0, (this.options.font_size + 7) * -1]);
  }
585659
function StackedBarChart(opts) {
      var me, _base2, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28;

      me = this;
      StackedBarChart.__super__.constructor.call(this, opts);
      me.styles = (_ref21 = opts.styles) != null ? _ref21 : '';
      me.colors = (_ref22 = opts.colors) != null ? _ref22 : [];
      me.titles = (_ref23 = opts.titles) != null ? _ref23 : ['', '', '', '', ''];
      me.values = (_ref24 = opts.values) != null ? _ref24 : [];
      me.width = (_ref25 = opts.width) != null ? _ref25 : 17;
      me.height = (_ref26 = opts.height) != null ? _ref26 : 30;
      me["class"] = (_ref27 = opts["class"]) != null ? _ref27 : 'barchart';
      if ((_ref28 = (_base2 = Raphael.fn).drawStackedBarChart) == null) {
        _base2.drawStackedBarChart = drawStackedBars;
      }
    }
761011
def _draw(self, tree, indent=0):
        """"""
        if all([
            isinstance(tree, dict),
            type(tree) != BarDescriptor
        ]):
            for k, v in sorted(tree.items()):
                bar_desc, subdict = v[0], v[1]

                args = [self.cursor.term] + bar_desc.get("args", [])
                kwargs = dict(title_pos="above", indent=indent, title=k)
                kwargs.update(bar_desc.get("kwargs", {}))

                b = Bar(*args, **kwargs)
                b.draw(value=bar_desc["value"].value, flush=False)

                self._draw(subdict, indent=indent + self.indent)
343956
private void drawAxisBars(Graphics2D chartGraphics) {
    if (axisThickness > 0) {
      chartGraphics.setColor(axisColour);

      // Draw x-axis.
      int x = heatMapTL.x - axisThickness;
      int y = heatMapBR.y;
      int width = heatMapSize.width + axisThickness;
      int height = axisThickness;
      chartGraphics.fillRect(x, y, width, height);

      // Draw y-axis.
      x = heatMapTL.x - axisThickness;
      y = heatMapTL.y;
      width = axisThickness;
      height = heatMapSize.height;
      chartGraphics.fillRect(x, y, width, height);
    }
  }
1062442
function drawLoop () {
  ctx.clearRect(0, 0, canvas.width, canvas.height)

  var centerX = canvas.width / 2
  var centerY = canvas.height / 2

  // draw circle
  ctx.beginPath()
  ctx.arc(centerX, centerY, 100, 0, 2 * Math.PI, false)
  ctx.fillStyle = 'yellow'
  ctx.fill()

  // draw three oscilloscopes in different positions and colors
  ctx.strokeStyle = 'lime'
  scope.draw(ctx, 0, 0, centerX, centerY)

  ctx.strokeStyle = 'cyan'
  scope.draw(ctx, centerX, 0, centerX, centerY)

  ctx.strokeStyle = 'red'
  scope.draw(ctx, 0, centerY, null, centerY)

  window.requestAnimationFrame(drawLoop)
}
9320
function drawHandles() {
            let handleFillColor = colorHelper.colorSchemasHuman.grey[1];

            // Styling
            handle = chartBrush
                        .selectAll('.handle.brush-rect')
                        .style('fill', handleFillColor);
        }
21504
function DrawYErrorBar($x_world,$y_world,$error_height,$error_bar_type,$color) {
    $x1 = $this->xtr($x_world);
    $y1 = $this->ytr($y_world);
    $y2 = $this->ytr($y_world+$error_height) ;

    for ($width = 0; $width < $this->error_bar_line_width; $width++) {
      ImageLine($this->img, $x1+$width, $y1 , $x1+$width, $y2, $color);
      ImageLine($this->img, $x1-$width, $y1 , $x1-$width, $y2, $color);
    }
    switch ($error_bar_type) {
      case "line":
        break;
      case "tee":
        ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color);
        break;
      default:
        ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color);
        break;
    }
    return true;
  }
406130
function drawRadialValueBox(context, options, value) {
    drawings.drawValueBox(context, options, value, 0,
        context.max - context.max * 0.33, context.max);
}
923985
protected void drawBars(Canvas _Canvas) {

        for (BarModel model : mData) {
            RectF bounds = model.getBarBounds();
            mGraphPaint.setColor(model.getColor());

            _Canvas.drawRect(
                    bounds.left,
                    bounds.bottom - (bounds.height() * mRevealValue),
                    bounds.right,
                    bounds.bottom, mGraphPaint);

            if (mShowValues) {
                _Canvas.drawText(Utils.getFloatString(model.getValue(), mShowDecimal), model.getLegendBounds().centerX(),
                        bounds.bottom - (bounds.height() * mRevealValue) - mValueDistance, mValuePaint);
            }
        }
    }
323052
function drawBackground(hostEl, ctx, style, x, y, width, height) {
    var textBackgroundColor = style.textBackgroundColor;
    var textBorderWidth = style.textBorderWidth;
    var textBorderColor = style.textBorderColor;
    var isPlainBg = isString(textBackgroundColor);

    setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);
    setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');
    setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);
    setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);

    if (isPlainBg || (textBorderWidth && textBorderColor)) {
        ctx.beginPath();
        var textBorderRadius = style.textBorderRadius;
        if (!textBorderRadius) {
            ctx.rect(x, y, width, height);
        }
        else {
            roundRectHelper.buildPath(ctx, {
                x: x, y: y, width: width, height: height, r: textBorderRadius
            });
        }
        ctx.closePath();
    }

    if (isPlainBg) {
        setCtx(ctx, 'fillStyle', textBackgroundColor);

        if (style.fillOpacity != null) {
            var originalGlobalAlpha = ctx.globalAlpha;
            ctx.globalAlpha = style.fillOpacity * style.opacity;
            ctx.fill();
            ctx.globalAlpha = originalGlobalAlpha;
        }
        else {
            ctx.fill();
        }
    }
    else if (isObject(textBackgroundColor)) {
        var image = textBackgroundColor.image;

        image = imageHelper.createOrUpdateImage(
            image, null, hostEl, onBgImageLoaded, textBackgroundColor
        );
        if (image && imageHelper.isImageReady(image)) {
            ctx.drawImage(image, x, y, width, height);
        }
    }

    if (textBorderWidth && textBorderColor) {
        setCtx(ctx, 'lineWidth', textBorderWidth);
        setCtx(ctx, 'strokeStyle', textBorderColor);

        if (style.strokeOpacity != null) {
            var originalGlobalAlpha = ctx.globalAlpha;
            ctx.globalAlpha = style.strokeOpacity * style.opacity;
            ctx.stroke();
            ctx.globalAlpha = originalGlobalAlpha;
        }
        else {
            ctx.stroke();
        }
    }
}
4229
function drawLine(values, style, minY) {
    style = style || {}
    var color = self.options.style.line
    c.strokeStyle = style.line || color

    c.moveTo(0, 0)
    c.beginPath();
    c.lineTo(getXPixel(0), getYPixel(values[0], minY));

    for(var k = 1; k < values.length; k++) {
      c.lineTo(getXPixel(k), getYPixel(values[k], minY));
    }

    c.stroke();
  }
1329631
function horizontalBarsTween(d) {
            let node = d3Selection.select(this),
                i = d3Interpolate.interpolateRound(0, xScale(getValue(d))),
                j = d3Interpolate.interpolateNumber(0, 1);

            return function (t) {
                node.attr('width', i(t))
                    .style('opacity', j(t));
            }
        }
281053
@Override
    protected void onGraphDraw(Canvas _Canvas) {
        super.onGraphDraw(_Canvas);
        _Canvas.translate(-mCurrentViewport.left, -mCurrentViewport.top);
        drawBars(_Canvas);
    }
516892
@Override
    public void draw(Canvas canvas) {
        Barcode barcode = mBarcode;
        if (barcode == null) {
            return;
        }

        // Draws the bounding box around the barcode.
        RectF rect = getViewBoundingBox(barcode);

        canvas.drawRect(rect, mOverlayPaint);

        /**
         * Draw the top left corner
         */
        canvas.drawLine(rect.left, rect.top, rect.left + CORNER_WIDTH, rect.top, mRectPaint);
        canvas.drawLine(rect.left, rect.top, rect.left, rect.top + CORNER_WIDTH, mRectPaint);

        /**
         * Draw the bottom left corner
         */
        canvas.drawLine(rect.left, rect.bottom, rect.left, rect.bottom - CORNER_WIDTH, mRectPaint);
        canvas.drawLine(rect.left, rect.bottom, rect.left + CORNER_WIDTH, rect.bottom, mRectPaint);

        /**
         * Draw the top right corner
         */
        canvas.drawLine(rect.right, rect.top, rect.right - CORNER_WIDTH, rect.top, mRectPaint);
        canvas.drawLine(rect.right, rect.top, rect.right, rect.top + CORNER_WIDTH, mRectPaint);

        /**
         * Draw the bottom right corner
         */
        canvas.drawLine(rect.right, rect.bottom, rect.right - CORNER_WIDTH, rect.bottom, mRectPaint);
        canvas.drawLine(rect.right, rect.bottom, rect.right, rect.bottom - CORNER_WIDTH, mRectPaint);
    }
437604
function triangleDraw(c, params)
{
    const size = params.size
    const half = params.size / 2
    c.beginPath()
    c.fillStyle = '#' + params.color.toString(16)
    c.moveTo(half, 0)
    c.lineTo(0, size)
    c.lineTo(size, size)
    c.closePath()
    c.fill()
    c.fillStyle = 'white'
    c.font = '40px Arial'
    const measure = c.measureText(n)
    c.fillText(n++, size / 2 - measure.width / 2, size / 2 + 10)
}