You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: linechart.go
    path of file: ./repos/slack-term/vendor/github.com/erroneousboat/termui
    
    the code of the file until where you have to start completion: // Copyright 2017 Zack Guo <zack.y.guo@gmail.com>. All rights reserved.
// Use of this source code is governed by a MIT license that can
// be found in the LICENSE file.

package termui

import (
	"fmt"
	"math"
)

// only 16 possible combinations, why bother
var braillePatterns = map[[2]int]rune{
	[2]int{0, 0}: '⣀',
	[2]int{0, 1}: '⡠',
	[2]int{0, 2}: '⡐',
	[2]int{0, 3}: '⡈',

	[2]int{1, 0}: '⢄',
	[2]int{1, 1}: '⠤',
	[2]int{1, 2}: '⠔',
	[2]int{1, 3}: '⠌',

	[2]int{2, 0}: '⢂',
	[2]int{2, 1}: '⠢',
	[2]int{2, 2}: '⠒',
	[2]int{2, 3}: '⠊',

	[2]int{3, 0}: '⢁',
	[2]int{3, 1}: '⠡',
	[2]int{3, 2}: '⠑',
	[2]int{3, 3}: '⠉',
}

var lSingleBraille = [4]rune{'\u2840', '⠄', '⠂', '⠁'}
var rSingleBraille = [4]rune{'\u2880', '⠠', '⠐', '⠈'}

// LineChart has two modes: braille(default) and dot. Using braille gives 2x capacity as dot mode,
// because one braille char can represent two data points.
/*
  lc := termui.NewLineChart()
  lc.BorderLabel = "braille-mode Line Chart"
  lc.Data = [1.2, 1.3, 1.5, 1.7, 1.5, 1.6, 1.8, 2.0]
  lc.Width = 50
  lc.Height = 12
  lc.AxesColor = termui.ColorWhite
  lc.LineColor = termui.ColorGreen | 
    
func (lc *LineChart) renderBraille() Buffer {
	buf := NewBuffer()

	// return: b -> which cell should the point be in
	//         m -> in the cell, divided into 4 equal height levels, which subcell?
	getPos := func(d float64) (b, m int) {
		cnt4 := int((d-lc.bottomValue)/(lc.scale/4) + 0.5)
		b = cnt4 / 4
		m = cnt4 % 4
		return
	}
	// plot points
	for i := 0; 2*i+1 < len(lc.Data) && i < lc.axisXWidth; i++ {
		b0, m0 := getPos(lc.Data[2*i])
		b1, m1 := getPos(lc.Data[2*i+1])

		if b0 == b1 {
			c := Cell{
				Ch: braillePatterns[[2]int{m0, m1}],
				Bg: lc.Bg,
				Fg: lc.LineColor,
			}
			y := lc.innerArea.Min.Y + lc.innerArea.Dy() - 3 - b0
			x := lc.innerArea.Min.X + lc.labelYSpace + 1 + i
			buf.Set(x, y, c)
		} else {
			c0 := Cell{Ch: lSingleBraille[m0],
				Fg: lc.LineColor,
				Bg: lc.Bg}
			x0 := lc.innerArea.Min.X + lc.labelYSpace + 1 + i
			y0 := lc.innerArea.Min.Y + lc.innerArea.Dy() - 3 - b0
			buf.Set(x0, y0, c0)

			c1 := Cell{Ch: rSingleBraille[m1],
				Fg: lc.LineColor,
				Bg: lc.Bg}
			x1 := lc.innerArea.Min.X + lc.labelYSpace + 1 + i
			y1 := lc.innerArea.Min.Y + lc.innerArea.Dy() - 3 - b1
			buf.Set(x1, y1, c1)
		}

	}
	return buf
}