|
|
@ -5347,6 +5347,7 @@ nv.models.multiBar = function() {
|
|
|
|
, clipEdge = true
|
|
|
|
, clipEdge = true
|
|
|
|
, stacked = false
|
|
|
|
, stacked = false
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
|
|
|
|
, hideable = false
|
|
|
|
, barColor = null // adding the ability to set the color for each rather than the whole group
|
|
|
|
, barColor = null // adding the ability to set the color for each rather than the whole group
|
|
|
|
, disabled // used in conjunction with barColor to communicate from multiBarHorizontalChart what series are disabled
|
|
|
|
, disabled // used in conjunction with barColor to communicate from multiBarHorizontalChart what series are disabled
|
|
|
|
, delay = 1200
|
|
|
|
, delay = 1200
|
|
|
@ -5374,12 +5375,23 @@ nv.models.multiBar = function() {
|
|
|
|
availableHeight = height - margin.top - margin.bottom,
|
|
|
|
availableHeight = height - margin.top - margin.bottom,
|
|
|
|
container = d3.select(this);
|
|
|
|
container = d3.select(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(hideable && data.length) hideable = [{
|
|
|
|
|
|
|
|
values: data[0].values.map(function(d) {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
x: d.x,
|
|
|
|
|
|
|
|
y: 0,
|
|
|
|
|
|
|
|
series: d.series,
|
|
|
|
|
|
|
|
size: 0.01
|
|
|
|
|
|
|
|
};}
|
|
|
|
|
|
|
|
)}];
|
|
|
|
|
|
|
|
nv.log(hideable, data)
|
|
|
|
|
|
|
|
|
|
|
|
if (stacked)
|
|
|
|
if (stacked)
|
|
|
|
data = d3.layout.stack()
|
|
|
|
data = d3.layout.stack()
|
|
|
|
.offset('zero')
|
|
|
|
.offset('zero')
|
|
|
|
.values(function(d){ return d.values })
|
|
|
|
.values(function(d){ return d.values })
|
|
|
|
.y(getY)
|
|
|
|
.y(getY)
|
|
|
|
(data);
|
|
|
|
(!data.length && hideable ? hideable : data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//add series index to each data point for reference
|
|
|
|
//add series index to each data point for reference
|
|
|
@ -5500,7 +5512,7 @@ nv.models.multiBar = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bars = groups.selectAll('rect.nv-bar')
|
|
|
|
var bars = groups.selectAll('rect.nv-bar')
|
|
|
|
.data(function(d) { return d.values });
|
|
|
|
.data(function(d) { return (hideable && !data.length) ? hideable.values : d.values });
|
|
|
|
|
|
|
|
|
|
|
|
bars.exit().remove();
|
|
|
|
bars.exit().remove();
|
|
|
|
|
|
|
|
|
|
|
@ -5733,6 +5745,12 @@ nv.models.multiBar = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.hideable = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return hideable;
|
|
|
|
|
|
|
|
hideable = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.delay = function(_) {
|
|
|
|
chart.delay = function(_) {
|
|
|
|
if (!arguments.length) return delay;
|
|
|
|
if (!arguments.length) return delay;
|
|
|
|
delay = _;
|
|
|
|
delay = _;
|
|
|
|