drawChart = chartKey => {
    const chart = charts[chartKey]
    const c = chart.chart
    c.clear()

    if (!charts[chartKey].plugin.initialized) {
      return false
    }

    const dataPointsToKeep = 5000

    charts[chartKey].values[position] = charts[chartKey].plugin.currentValue

    const computeValue = input => chart.height - Math.floor(((chart.height + 1) / 100) * input) - 1

    if (position > dataPointsToKeep) {
      delete charts[chartKey].values[position - dataPointsToKeep]
    }

    for (const pos in charts[chartKey].values) {
      if (graphScale >= 1 || (graphScale < 1 && pos % (1 / graphScale) === 0)) {
        const p = parseInt(pos, 10) + (chart.width - charts[chartKey].values.length)
        // calculated x-value based on graphScale
        const x = (p * graphScale) + ((1 - graphScale) * chart.width)

        // draws top line of chart
        if (p > 1 && computeValue(charts[chartKey].values[pos - 1]) > 0) {
          c.set(x, computeValue(charts[chartKey].values[pos - 1]))
        }

        // Start deleting old data points to improve performance
        // @todo: This is not be the best place to do this

        // fills all area underneath top line
        for (let y = computeValue(charts[chartKey].values[pos - 1]); y < chart.height; y++) {
          if (graphScale > 1 && p > 0 && y > 0) {
            const current = computeValue(charts[chartKey].values[pos - 1])
            const next = computeValue(charts[chartKey].values[pos])
            const diff = (next - current) / graphScale

            // adds columns between data if graph is zoomed in, takes average where data is missing to make smooth curve
            for (let i = 0; i < graphScale; i++) {
              c.set(x + i, y + (diff * i))
              for (let j = y + (diff * i); j < chart.height; j++) {
                c.set(x + i, j)
              }
            }
          } else if (graphScale <= 1) {
            // magic number used to calculate when to draw a value onto the chart
            // @TODO: Remove this?
            // var allowedPValues = (charts[chartKey].values.length - ((graphScale * charts[chartKey].values.length) + 1)) * -1
            c.set(x, y)
          }
        }
      }
    }

    // Add percentage to top right of the chart by splicing it into the braille data
    const textOutput = c.frame().split('\n')
    const percent = `   ${chart.plugin.currentValue}`
    textOutput[0] = `${textOutput[0].slice(0, textOutput[0].length - 4)}{white-fg}${percent.slice(-3)}%{/white-fg}`

    return textOutput.join('\n')
  }
This draws a chart
@param  {int} chartKey The key of the chart.
@return {string}       The text output to draw.