selectAll("rect") change from "types" to "total"