allowing the bullet chart to hide the previous data point if the value is null

master-patched
Ricardo 12 years ago
parent 38ba70f4dc
commit cdb68dafca

@ -1193,22 +1193,26 @@ nv.models.bullet = function() {
})
var h3 = availableHeight / 6;
g.selectAll('path.nv-markerTriangle')
.attr('transform', function(d) { return 'translate(' + x1(markerz[0]) + ',' + (availableHeight / 2) + ')' })
.attr('d', 'M0,' + h3 + 'L' + h3 + ',' + (-h3) + ' ' + (-h3) + ',' + (-h3) + 'Z')
.on('mouseover', function() {
dispatch.elementMouseover({
value: markerz[0],
label: 'Previous',
pos: [x1(markerz[0]), availableHeight/2]
})
})
.on('mouseout', function() {
dispatch.elementMouseout({
value: markerz[0],
label: 'Previous'
if (markerz[0]) {
g.selectAll('path.nv-markerTriangle')
.attr('transform', function(d) { return 'translate(' + x1(markerz[0]) + ',' + (availableHeight / 2) + ')' })
.attr('d', 'M0,' + h3 + 'L' + h3 + ',' + (-h3) + ' ' + (-h3) + ',' + (-h3) + 'Z')
.on('mouseover', function() {
dispatch.elementMouseover({
value: markerz[0],
label: 'Previous',
pos: [x1(markerz[0]), availableHeight/2]
})
})
});
.on('mouseout', function() {
dispatch.elementMouseout({
value: markerz[0],
label: 'Previous'
})
});
} else {
g.selectAll('path.nv-markerTriangle').remove();
}
wrap.selectAll('.nv-range')

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -153,22 +153,26 @@ nv.models.bullet = function() {
})
var h3 = availableHeight / 6;
g.selectAll('path.nv-markerTriangle')
.attr('transform', function(d) { return 'translate(' + x1(markerz[0]) + ',' + (availableHeight / 2) + ')' })
.attr('d', 'M0,' + h3 + 'L' + h3 + ',' + (-h3) + ' ' + (-h3) + ',' + (-h3) + 'Z')
.on('mouseover', function() {
dispatch.elementMouseover({
value: markerz[0],
label: 'Previous',
pos: [x1(markerz[0]), availableHeight/2]
})
})
.on('mouseout', function() {
dispatch.elementMouseout({
value: markerz[0],
label: 'Previous'
if (markerz[0]) {
g.selectAll('path.nv-markerTriangle')
.attr('transform', function(d) { return 'translate(' + x1(markerz[0]) + ',' + (availableHeight / 2) + ')' })
.attr('d', 'M0,' + h3 + 'L' + h3 + ',' + (-h3) + ' ' + (-h3) + ',' + (-h3) + 'Z')
.on('mouseover', function() {
dispatch.elementMouseover({
value: markerz[0],
label: 'Previous',
pos: [x1(markerz[0]), availableHeight/2]
})
})
});
.on('mouseout', function() {
dispatch.elementMouseout({
value: markerz[0],
label: 'Previous'
})
});
} else {
g.selectAll('path.nv-markerTriangle').remove();
}
wrap.selectAll('.nv-range')

Loading…
Cancel
Save