krispo / angular-nvd3

AngularJS directive for NVD3 reusable charting library (based on D3). Easily customize your charts via JSON API.
http://krispo.github.io/angular-nvd3
MIT License
1.29k stars 377 forks source link

Tooltip on force directed graph - show only some properties #655

Open dashmaker opened 7 years ago

dashmaker commented 7 years ago

Hi, I have been trying to get the tool-tip on the forceDirectedGraph to only show selected properties (e.g. d.name) but instead it shows a set of additional properties such as index, x, y, px, py, etc... I've looked through the documentation but can't seem to find an explanation or instructions.

screenshot from 2017-04-09 15-07-11_cropped

Any advice, workaround or solution would be welcome. Thanks!

causztic commented 7 years ago

Hello,

I've been trying to find this and I found a solution: If you are using the wrapper, do:

            chart: {
                    //...
                    tooltip: {
                        contentGenerator: function(d){
                            return ""; // change your tooltip here
                        }
                    }
          }