allowing the bullet chart to hide the previous data point if the value is null
This commit is contained in:
parent
38ba70f4dc
commit
cdb68dafca
34
nv.d3.js
34
nv.d3.js
@ -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]
|
||||
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'
|
||||
})
|
||||
});
|
||||
.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
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]
|
||||
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'
|
||||
})
|
||||
});
|
||||
.on('mouseout', function() {
|
||||
dispatch.elementMouseout({
|
||||
value: markerz[0],
|
||||
label: 'Previous'
|
||||
})
|
||||
});
|
||||
} else {
|
||||
g.selectAll('path.nv-markerTriangle').remove();
|
||||
}
|
||||
|
||||
|
||||
wrap.selectAll('.nv-range')
|
||||
|
Loading…
Reference in New Issue
Block a user