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:
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.
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