    def _setup_chart(self):
        """
        Draws any borders and returns initial height, width, and starting X and Y.
        """
        # Dimensions for the chart.
        int_h = self._canvas.height
        int_w = self._canvas.width
        start_x = 0
        start_y = 0

        # Create  the box around the chart...
        if self._border:
            draw = self._border_lines.box_top(self._canvas.width)
            self._write(draw, 0, 0)
            for line in range(1, self._canvas.height):
                self._write(self._border_lines.v, 0, line)
                self._write(self._border_lines.v, self._canvas.width - 1, line)
            draw = self._border_lines.box_bottom(self._canvas.width)
            self._write(draw, 0, self._canvas.height - 1)
            int_h -= 4
            int_w -= 6
            start_y += 2
            start_x += 3

        return int_h, int_w, start_x, start_y
Draws any borders and returns initial height, width, and starting X and Y.
asciimatics/renderers/charts.py