score:3

Accepted answer

Could not find anything in the API to do this.

But here is a bit of hack to do it via d3:

After render

1) get all the text DOM

2) run a for loop on all the text.

3) get the text's data and change the inner HTML.

  dispatch: {
    renderEnd: function(e) {
      //for each text
      d3.selectAll(".nv-legend text")[0].forEach(function(d){
        //get the data
        var t= d3.select(d).data()[0];
        //set the new data in the innerhtml
        d3.select(d).html(t.key + " - " + t.y);
      });
    }
  }

working code here


Related Query