I'm using nvd3-bullet-chart from angularjs-nvd3-directives library to display maximum, current and average data. I'm setting the minimum variable in the array to 0 because I don't need to display that. I have another data point and I'm using the markers array to display the triangle marker. I have a use case where I need to selectively show and hide the triangle marker. I can hide it by setting the value of the markers array as [0]. But then when I change it's value to a non-zero value the marker does not appear again. It seems like after the marker is removed from the DOM it's not added again. I'm using angularjs-nvd3-directives - v0.0.7, D3 - v3.4.13, nvd3 - v1.1.15b and angular - v1.3.6. Any help is much appreciated!
Asked
Active
Viewed 569 times
1 Answers
0
I was able to fix this problem by grabbing the marker element from the DOM using D3 select and then setting the style.display property to 'none'. I was also not setting the value of the markers array to 0 but a very small value(0.001) so the marker element is not removed from the DOM. This works but it's not an elegant solution.

bazzinga
- 165
- 1
- 5
- 16