def to_js
      js = "var data_table = new google.visualization.DataTable();"

      @cols.each do |column|
        js << "data_table.addColumn("
        js << display(column)
        js << ");"
      end

      @rows.each do |row|
        js << "data_table.addRow("
        js << "[#{row.map(&:to_js).join(", ")}]" unless row.empty?
        js << ");"
      end

      if @formatters
        @formatters.each do |formatter|
          js << formatter.to_js
        end
      end

      js
    end
def to_js
      js = "var data_table = new google.visualization.DataTable();"

      @cols.each do |column|
        js << "data_table.addColumn("
        js << display(column)
        js << ");"
      end

      @rows.each do |row|
        js << "data_table.addRow("
        js << "[#{row.map(&:to_js).join(", ")}]" unless row.empty?
        js << ");"
      end

      if @formatters
        @formatters.each do |formatter|
          js << formatter.to_js
        end
      end

      js
    end
Returns the JavaScript equivalent for this data_table instance.