How to disable legend in nvd3 or limit it's size

Dav*_*kin 20 bubble-chart legend scatter-plot d3.js nvd3.js

I'm using nvd3 and have a few charts where the legend is much to large. E.g. a scatter/bubble with 15 groups and the group names are long. The legend is so large that it leaves almost no room for the chart itself.

Is there a way to remove the legend or toggle the legend or limit the height/width it is taking up? Any example would be great.

Also, is there a way to have the bubble show a descriptive string? Right now when you stand on top of a bubble it highlights the x/y coordinates. I also want it to show the bubble name.

例如,我的每个气泡代表一个国家(有一个名字),x是GDP,y是债务.该组是分类/非名称.

sha*_*r90 36

.showLegend(false)会帮助你.这是一个例子 -

chart = nv.models.multiBarHorizontalChart().x(function(d) {
                return d.x
            }).y(function(d) {
                return d.y
            }).showLegend(false);
Run Code Online (Sandbox Code Playgroud)