Merge branch 'feature/fix-wrong-series'

This commit is contained in:
Itay Neeman 2012-07-13 19:12:23 -07:00
commit 2bd33fe395
3 changed files with 10 additions and 7 deletions

View File

@ -134,7 +134,8 @@ nv.models.multiBar = function() {
})
.attr('y', function(d) { return y0(stacked ? d.y0 : 0) })
.attr('height', 0)
.attr('width', x.rangeBand() / (stacked ? 1 : data.length) )
.attr('width', x.rangeBand() / (stacked ? 1 : data.length) );
bars
.on('mouseover', function(d,i) { //TODO: figure out why j works above, but not here
d3.select(this).classed('hover', true);
dispatch.elementMouseover({

View File

@ -106,7 +106,13 @@ nv.models.multiBarHorizontal = function() {
var barsEnter = bars.enter().append('g')
.attr('transform', function(d,i,j) {
return 'translate(' + y0(stacked ? d.y0 : 0) + ',' + (stacked ? 0 : (j * x.rangeBand() / data.length ) + x(getX(d,i))) + ')'
})
});
barsEnter.append('rect')
.attr('width', 0)
.attr('height', x.rangeBand() / (stacked ? 1 : data.length) )
bars
.on('mouseover', function(d,i) { //TODO: figure out why j works above, but not here
d3.select(this).classed('hover', true);
dispatch.elementMouseover({
@ -155,10 +161,6 @@ nv.models.multiBarHorizontal = function() {
d3.event.stopPropagation();
});
barsEnter.append('rect')
.attr('width', 0)
.attr('height', x.rangeBand() / (stacked ? 1 : data.length) )
if (showValues && !stacked) {
barsEnter.append('text')
.attr('text-anchor', function(d,i) { return getY(d,i) < 0 ? 'end' : 'start' })

View File

@ -8,7 +8,7 @@ nv.models.multiBarHorizontalChart = function() {
showLegend = true,
tooltips = true,
tooltip = function(key, x, y, e, graph) {
return '<h3>' + x + '</h3>' +
return '<h3>' + key + " - " + x + '</h3>' +
'<p>' + y + '</p>'
};