1

I am creating a chart which using Angular-nvd3 library which base on nvd3 and d3.js and I have a problem that I want to display the percent in the chart barLine and the total number in the chart horizontalLIne something looks like this: enter image description here

But currently, I don't know how to do that. I have created a plnkr: [http://plnkr.co/edit/PygsTn?p=preview][2]

Hope I can get some help. Thank you for taking time to look at my question.

Le Dac Sy
  • 381
  • 3
  • 16

1 Answers1

0

You can do it with valueFormat property:

chart: {
    valueFormat: function(value){
        return Math.floor(value/TOTAL * 100) + "%";
    }
}

Modified plunker: http://plnkr.co/edit/ilaNl5KEqZa02HbWby9s?p=preview

Lukasz Wiktor
  • 19,644
  • 5
  • 69
  • 82