normally you would use a scale for colors, something like
declare it like so
colorScale = d3.scaleOrdinal().domain(categories).range(["#FFD700", "#C0C0C0"])
then use it like so
zDomain: colorScale.domain()
colors: colorScale.range()
this would allow for example to add a legend easily
.insert() is just a different flavor of .append()
.append("image") would put add the image as the last element in the chart so it will be on top of all the bars
.insert("image", "g") would solve it by doing what?
That is super cool, It feels contradictory that it would go first to go behind the bars but then it makes sense because code reads left to right. Thanks!
Think those in-line comments do a good job explaining what is going on. watched another tutorial going into more depth about the importance of Dom and data elements in d3 which helped a lot. I can go over it with you after class too on Thursday if you would like.