Fixed Issues #161 and #166 in the stackedAreaChart

master-patched
Bob Monteverde 12 years ago
parent 075e862b96
commit e4102891c0

@ -9403,21 +9403,28 @@ nv.models.stackedAreaChart = 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();
}
//------------------------------------------------------------
@ -9597,9 +9604,6 @@ nv.models.stackedAreaChart = function() {
});
chart.update = function() { chart(selection) };
chart.container = this;
return chart;
}
@ -9647,7 +9651,10 @@ nv.models.stackedAreaChart = 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;
};

2
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -68,21 +68,28 @@ nv.models.stackedAreaChart = 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();
}
//------------------------------------------------------------
@ -262,9 +269,6 @@ nv.models.stackedAreaChart = function() {
});
chart.update = function() { chart(selection) };
chart.container = this;
return chart;
}
@ -312,7 +316,10 @@ nv.models.stackedAreaChart = 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;
};

Loading…
Cancel
Save