function drawBar(
  x,
  y,
  width,
  height,
  className,
  JSONcontainer,
  svgContainer,
  style
) {
  if (height != 0) {
    if (height < 0) {
      height *= -1;
      y -= height;
    }
    const rect = getSVGElement("rect", JSONcontainer, svgContainer);
    rect.setAttributeNS(null, "x", x - 0.5 * width);
    rect.setAttributeNS(null, "y", y);
    rect.setAttributeNS(null, "width", width);
    rect.setAttributeNS(null, "height", height);
    rect.setAttributeNS(null, "class", className);
    if (style) {
      rect.setAttributeNS(null, "style", style);
    }
  }
}
draw a bar SVG element centered on the X coordinate
@param {number} x
@param {number} y
@param {number} width
@param {number} height
@param {string} className
@param {object} JSONcontainer
@param {object} svgContainer
@param {string} style