Reputation: 2788
I am using the combination of Angular material and NVD3 while investigating why tooltips are not visible for me.
I have chopped and cloned the example provided from http://krispo.github.io/angular-nvd3/#/quickstart to plunker and it is something like this:
While the same one on angular material with nvd3 wrapper looks like this (no tooltip)
Was wandering if anyone had a similar experience and how it got resolved.
Declaration:
<nvd3 options="chartChartOptions" data="chartData"></nvd3>
and inside the controller
$scope.chartChartOptions = {
chart: {
type: 'multiBarChart',
height: 450,
margin : {
top: 20,
right: 20,
bottom: 45,
left: 45
},
clipEdge: true,
duration: 500,
stacked: true,
xAxis: {
axisLabel: 'Time (ms)',
showMaxMin: false,
tickFormat: function(d){
return d3.format(',f')(d);
}
},
yAxis: {
axisLabel: 'Y Axis',
axisLabelDistance: -20,
tickFormat: function(d){
return d3.format(',.1f')(d);
}
}
}
};
$scope.chartData = [{"key":"Stream0","values":[{"x":1,"y":1.2191711805077412,"y0":0,"series":0,"key":"Stream0","size":1.2191711805077412,"y1":1.2191711805077412}]},{"key":"Stream1","values":[{"x":1,"y":2.8682672436400285,"y0":1.2191711805077412,"series":1,"key":"Stream1","size":2.8682672436400285,"y1":4.08743842414777}]},{"key":"Stream2","values":[{"x":1,"y":0.18054369373704626,"y0":4.08743842414777,"series":2,"key":"Stream2","size":0.18054369373704626,"y1":4.2679821178848165}]}];
For versions of libraries:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-beta.1/angular-sanitize.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.1/nv.d3.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-material-data-table/0.9.11/md-data-table.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ng-csv/0.3.6/ng-csv.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-nvd3/1.0.5/angular-nvd3.min.js"></script>
I have tried trial and error but without help, anyone in a similar situation?
Upvotes: 0
Views: 372
Reputation: 930
Sometimes this also occurs using the option useInteractiveGuideline
with true
value. Thsi is caused because there's a issue between the tooltips options being true. A way to make this work is creating a callback for the tooltip and set "useInteractiveGuideline:true
"
callback: function(chart) {
$timeout(function() {
d3.selectAll('.nvtooltip').style('opacity', 0);
}, 100);
},
useInteractiveGuideline: true,
tooltips: true,
Upvotes: 1
Reputation: 2788
After lot's of digging, we had forgotten to include all framework's CSS sheets which would render the graph visible.
Upvotes: 0