|
|
@ -6108,6 +6108,7 @@ nv.models.multiBarHorizontal = function() {
|
|
|
|
, getY = function(d) { return d.y }
|
|
|
|
, getY = function(d) { return d.y }
|
|
|
|
, forceY = [0] // 0 is forced by default.. this makes sense for the majority of bar graphs... user can always do chart.forceY([]) to remove
|
|
|
|
, forceY = [0] // 0 is forced by default.. this makes sense for the majority of bar graphs... user can always do chart.forceY([]) to remove
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
|
|
|
|
, barColor = null // adding the ability to set the color for each rather than the whole group
|
|
|
|
, stacked = false
|
|
|
|
, stacked = false
|
|
|
|
, showValues = false
|
|
|
|
, showValues = false
|
|
|
|
, valuePadding = 60
|
|
|
|
, valuePadding = 60
|
|
|
@ -6300,9 +6301,11 @@ nv.models.multiBarHorizontal = function() {
|
|
|
|
|
|
|
|
|
|
|
|
bars
|
|
|
|
bars
|
|
|
|
.attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive'})
|
|
|
|
.attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive'})
|
|
|
|
//.attr('transform', function(d,i,j) {
|
|
|
|
|
|
|
|
//return 'translate(' + y0(stacked ? d.y0 : 0) + ',' + x(getX(d,i)) + ')'
|
|
|
|
if (barColor) {
|
|
|
|
//})
|
|
|
|
bars.style('fill', barColor).style('stroke', barColor);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (stacked)
|
|
|
|
if (stacked)
|
|
|
|
d3.transition(bars)
|
|
|
|
d3.transition(bars)
|
|
|
|
//.delay(function(d,i) { return i * delay / data[0].values.length })
|
|
|
|
//.delay(function(d,i) { return i * delay / data[0].values.length })
|
|
|
@ -6426,6 +6429,12 @@ nv.models.multiBarHorizontal = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.barColor = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return barColor;
|
|
|
|
|
|
|
|
barColor = nv.utils.getColor(_);
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.id = function(_) {
|
|
|
|
chart.id = function(_) {
|
|
|
|
if (!arguments.length) return id;
|
|
|
|
if (!arguments.length) return id;
|
|
|
|
id = _;
|
|
|
|
id = _;
|
|
|
|