text: BarChart = function(_parentElement, _data){
      this.parentElement = _parentElement;
      this.data = _data;
      this.displayData = []; // see data wrangling
  
      this.filteredData = this.data;
  
      // DEBUG RAW DATA
      //console.log(this.data);
  
      this.initVis();
  }
  
  
  
  /*
   * Initialize visualization (static content, e.g. SVG area or axes)
   */
  
  BarChart.prototype.initVis = function(){
      var vis = this;
  
      vis.margin = { top: 40, right: 0, bottom: 60, left: 60 };
  
      vis.width = 800 - vis.margin.left - vis.margin.right,
          vis.height = 400 - vis.margin.top - vis.margin.bottom;
  
  
      // SVG drawing area
      vis.svg = d3.select("#" + vis.parentElement).append("svg")
          .attr("width", vis.width + vis.margin.left + vis.margin.right)
          .attr("height", vis.height + vis.margin.top + vis.margin.bottom)
          .append("g")
          .attr("transform", "translate(" + vis.margin.left + "," + vis.margin.top + ")");
  
      // Overlay with path clipping
      vis.svg.append("defs").append("clipPath")
          .attr("id", "clip")
          .append("rect")
          .attr("width", vis.width)
          .attr("height", vis.height);
  
  
      // Scales and axes
      vis.x = d3.time.scale()
          .range([0, vis.width])
          .domain(d3.extent(vis.data, function(d) { return d.Year; }));
  
      vis.y = d3.scale.linear()
          .range([vis.height, 0]);
  
      vis.xAxis = d3.svg.axis()
          .scale(vis.x)
          .orient("bottom");
  
      vis.yAxis = d3.svg.axis()
          .scale(vis.y)
          .orient("left");
  
      vis.svg.append("g")
          .attr("class", "x-axis axis")
          .attr("transform", "translate(0," + vis.height + ")");
  
      vis.svg.append("g")
          .attr("class", "y-axis axis");
  
  
  
      // (Filter, aggregate, modify data)
      vis.wrangleData();
  }
  
  
  
  /*
   * Data wrangling
   */
  
  BarChart.prototype.wrangleData = function(){
      var vis = this;
  
      vis.displayData = vis.data;
  
      // Update the visualization
      vis.updateVis();
  }
  
  
  
  /*
   * The drawing function - should use the D3 update sequence (enter, update, exit)
   * Function parameters only needed if different kinds of updates are needed
   */
  
  BarChart.prototype.updateVis = function(){
      var vis = this;
  
  
  
      // Call axis functions with the new domain
      vis.svg.select(".x-axis").call(vis.xAxis);
      vis.svg.select(".y-axis").call(vis.yAxis);
  }
  
  
  