|
|
|
@ -567,7 +567,10 @@ nv.models.axis = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if(!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -825,7 +828,10 @@ nv.models.historicalBar = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -1120,7 +1126,10 @@ nv.models.bullet = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -1205,16 +1214,21 @@ nv.models.bulletChart = function() {
|
|
|
|
|
/*
|
|
|
|
|
// Disabled until I figure out a better way to check for no data with the bullet chart
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -1439,7 +1453,10 @@ nv.models.bulletChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -1577,16 +1594,21 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -1839,7 +1861,10 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2162,7 +2187,10 @@ nv.models.discreteBar = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2315,16 +2343,21 @@ nv.models.discreteBarChart = function() {
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -2466,7 +2499,10 @@ nv.models.discreteBarChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2616,7 +2652,10 @@ nv.models.distribution = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2695,6 +2734,9 @@ nv.models.indentedTree = function() {
|
|
|
|
|
.children(function(d) { return d.values })
|
|
|
|
|
.size([height, childIndent]); //Not sure if this is needed now that the result is HTML
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
@ -2880,9 +2922,6 @@ nv.models.indentedTree = function() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
@ -2895,7 +2934,10 @@ nv.models.indentedTree = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -3126,7 +3168,10 @@ nv.models.legend = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -3381,7 +3426,10 @@ nv.models.line = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -3732,7 +3780,10 @@ nv.models.lineChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -3860,21 +3911,29 @@ nv.models.linePlusBarChart = function() {
|
|
|
|
|
availableHeight = (height || parseInt(container.style('height')) || 400)
|
|
|
|
|
- margin.top - margin.bottom;
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -4068,8 +4127,6 @@ nv.models.linePlusBarChart = function() {
|
|
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -4141,7 +4198,10 @@ nv.models.linePlusBarChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -4282,21 +4342,29 @@ nv.models.lineWithFocusChart = function() {
|
|
|
|
|
- margin.top - margin.bottom - height2,
|
|
|
|
|
availableHeight2 = height2 - margin2.top - margin2.bottom;
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight1 / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -4594,9 +4662,6 @@ nv.models.lineWithFocusChart = function() {
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
@ -4655,7 +4720,10 @@ nv.models.lineWithFocusChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -5016,7 +5084,10 @@ nv.models.multiBar = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -5175,21 +5246,29 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
availableHeight = (height || parseInt(container.style('height')) || 400)
|
|
|
|
|
- margin.top - margin.bottom;
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display noData message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -5374,9 +5453,6 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
@ -5417,7 +5493,10 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -5767,7 +5846,10 @@ nv.models.multiBarHorizontal = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -5937,21 +6019,29 @@ nv.models.multiBarHorizontalChart = function() {
|
|
|
|
|
availableHeight = (height || parseInt(container.style('height')) || 400)
|
|
|
|
|
- margin.top - margin.bottom;
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -6123,9 +6213,6 @@ nv.models.multiBarHorizontalChart = function() {
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.update = function() { selection.transition().call(chart) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
@ -6166,7 +6253,10 @@ nv.models.multiBarHorizontalChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -6950,7 +7040,10 @@ nv.models.ohlcBar = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -7256,7 +7349,10 @@ nv.models.pie = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -7399,16 +7495,21 @@ nv.models.pieChart = function() {
|
|
|
|
|
// Display No Data message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -7533,7 +7634,10 @@ nv.models.pieChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -8192,21 +8296,29 @@ nv.models.scatterChart = function() {
|
|
|
|
|
availableHeight = (height || parseInt(container.style('height')) || 400)
|
|
|
|
|
- margin.top - margin.bottom;
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
// Display noData message if there's nothing to show.
|
|
|
|
|
|
|
|
|
|
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
|
|
|
|
container.append('text')
|
|
|
|
|
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
|
|
|
|
|
|
|
|
|
noDataText.enter().append('text')
|
|
|
|
|
.attr('class', 'nvd3 nv-noData')
|
|
|
|
|
.attr('x', availableWidth / 2)
|
|
|
|
|
.attr('y', availableHeight / 2)
|
|
|
|
|
.attr('dy', '-.7em')
|
|
|
|
|
.style('text-anchor', 'middle')
|
|
|
|
|
.text(noData);
|
|
|
|
|
return chart;
|
|
|
|
|
.style('text-anchor', 'middle');
|
|
|
|
|
|
|
|
|
|
noDataText
|
|
|
|
|
.attr('x', margin.left + availableWidth / 2)
|
|
|
|
|
.attr('y', margin.top + availableHeight / 2)
|
|
|
|
|
.text(function(d) { return d });
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
} else {
|
|
|
|
|
container.select('.nv-noData').remove();
|
|
|
|
|
container.selectAll('.nv-noData').remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
@ -8473,9 +8585,6 @@ nv.models.scatterChart = function() {
|
|
|
|
|
y0 = y.copy();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.update = function() { chart(selection) };
|
|
|
|
|
chart.container = this;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
@ -8519,7 +8628,10 @@ nv.models.scatterChart = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -8699,7 +8811,10 @@ nv.models.sparkline = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -8977,7 +9092,10 @@ nv.models.sparklinePlus = function() {
|
|
|
|
|
|
|
|
|
|
chart.margin = function(_) {
|
|
|
|
|
if (!arguments.length) return margin;
|
|
|
|
|
margin = _;
|
|
|
|
|
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
|
|
|
|
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
|
|
|
|
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
|
|
|
|
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
|
|
|
|
return chart;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|