var jade = require('jade')

module.exports = function(data, options) {

    var html = jade.renderFile(__dirname + '/templates/barchart.jade', {
        data: data,
        title: options.title,
        highlight: options.highlight,
        c: options.color,
        a: options.alter,
        w: options.width,
        m: options.margin
    })

    return html
}

@@ -63,16 +63,361 @@
 tions) %7B
+%0A    if (options.normalize) %7B%0A      var min = Math.min.apply(Math, data)%0A      var max = Math.max.apply(Math, data)%0A      var range = max - min%0A      var step = options.normalize / range%0A      var normalized = %5B%5D%0A%0A      for (var i = 0; i %3C data.length; i++) %7B%0A        normalized.push((data%5Bi%5D - min) * step)%0A      %7D%0A      data = normalized%0A    %7D
 %0A%0A    va

barchart's height can be normalized to 0 - 100 #13