Removing Legend Labels

The text labels in a legend can be removed/disabled by setting the .label( ) method to false. This is common practice when using images, as in the Images in Legends example (which this code is based on).

var data = [
  {id: "Apple", color: "orange", image: "https://datausa.io/static/img/attrs/thing_apple.png"},
  {id: "Fish", color: "blue", image: "https://datausa.io/static/img/attrs/thing_fish.png"},
  {id: "Tomato", color: "red", image: "https://datausa.io/static/img/attrs/thing_tomato.png"}
];

var legend = new d3plus.Legend()
  .data(data)
  .label(false)
  .shapeConfig({
    backgroundImage: function(d) { return d.image; },
    fill: function(d) { return d.color; },
    height: 25,
    width: 25
  })
  .render();