|
|
|
@ -490,7 +490,6 @@ nv.models.axis = function() {
|
|
|
|
|
var axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
|
|
|
|
|
//.data(scale.domain())
|
|
|
|
|
.data([scale.domain()[0], scale.domain()[scale.domain().length - 1]]);
|
|
|
|
|
axisMaxMin.enter().append('g').attr('class', 'nv-axisMaxMin').append('text');
|
|
|
|
|
axisMaxMin.exit().remove();
|
|
|
|
|
axisMaxMin
|
|
|
|
|
.attr('transform', function(d,i) {
|
|
|
|
@ -7784,6 +7783,7 @@ nv.models.pie = function() {
|
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
|
, valueFormat = d3.format(',.2f')
|
|
|
|
|
, showLabels = true
|
|
|
|
|
, pieLabelsOutside = true
|
|
|
|
|
, donutLabelsOutside = false
|
|
|
|
|
, labelThreshold = .02 //if slice percentage is under this, don't show label
|
|
|
|
|
, donut = false
|
|
|
|
@ -7907,9 +7907,15 @@ nv.models.pie = function() {
|
|
|
|
|
|
|
|
|
|
if (showLabels) {
|
|
|
|
|
// This does the normal label
|
|
|
|
|
var labelsArc = arc;
|
|
|
|
|
var labelsArc
|
|
|
|
|
if (pieLabelsOutside){
|
|
|
|
|
labelsArc = arc;
|
|
|
|
|
}else{
|
|
|
|
|
labelsArc = d3.svg.arc().innerRadius(0);
|
|
|
|
|
}
|
|
|
|
|
//var labelsArc = arc;
|
|
|
|
|
if (donutLabelsOutside) {
|
|
|
|
|
labelsArc = d3.svg.arc().outerRadius(arc.outerRadius())
|
|
|
|
|
labelsArc = d3.svg.arc().outerRadius(arc.outerRadius());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ae.append("g").classed("nv-label", true)
|
|
|
|
@ -8080,6 +8086,12 @@ nv.models.pie = function() {
|
|
|
|
|
donutLabelsOutside = _;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
chart.pieLabelsOutside = function(_) {
|
|
|
|
|
if (!arguments.length) return pieLabelsOutside;
|
|
|
|
|
pieLabelsOutside = _;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
chart.donut = function(_) {
|
|
|
|
|
if (!arguments.length) return donut;
|
|
|
|
@ -8110,7 +8122,6 @@ nv.models.pie = function() {
|
|
|
|
|
labelThreshold = _;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -8332,7 +8343,7 @@ nv.models.pieChart = function() {
|
|
|
|
|
chart.dispatch = dispatch;
|
|
|
|
|
chart.pie = pie;
|
|
|
|
|
|
|
|
|
|
d3.rebind(chart, pie, 'valueFormat', 'values', 'x', 'y', 'id', 'showLabels', 'donutLabelsOutside', 'donut', 'labelThreshold');
|
|
|
|
|
d3.rebind(chart, pie, 'valueFormat', 'values', 'x', 'y', 'id', 'showLabels', 'donutLabelsOutside', 'pieLabelsOutside', 'donut', 'labelThreshold');
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|