i have following d3 pie chart
i created this using following js code
function piechart(){
var usapass = 20;
var usafail = 40;
var usasum = usapass + usafail;
var englandpass = 10;
var englandfail = 60;
var englandsum = englandpass + englandfail;
var pieChartData = [
{ 'label': 'USA', 'value' : usasum, 'color': COLOR_RED },
{ 'label': 'ENGLAND', 'value' : englandsum, 'color': COLOR_ORANGE }
];
nv.addGraph(function() {
var pieChart = nv.models.pieChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.showLabels(true)
.labelThreshold(.05);
d3.select('#nv-pie-chartmy').append('svg')
.datum(pieChartData)
.transition().duration(350)
.call(pieChart);
return pieChart;
});
}
and my HTML code
<div id="nv-pie-chartmy" class="height-sm"></div>
currently when mouse hover on one slice it displays 'USA 60' like shown in the image. but what i want it to show something like bellow
USA Pass: 20 Fail : 40
without showing the entire count. currently showing the entire count. any idea how to display it