如何更改NVD3图表中的图例位置? [英] How do I change the legend position in a NVD3 chart?

查看:451
本文介绍了如何更改NVD3图表中的图例位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何在NVD3图表中相对于图表本身重新定位图例?

Does anyone know how to reposition the legend in a NVD3 chart relative to the graph itself?

它默认在顶部,我想它去(更好地利用我的应用程序中的空间)

It is on top by default, and I would like it to go on the side (better use of space within my app)

我想做的一个例子:

An example of what I would like to do:

推荐答案

选项,但您可以手动选择包含图例的 g 元素并移动它,例如

There is AFAIK no option to do this, but you can select the g element that contains the legend manually and move it, e.g.

d3.select(".nv-legendWrap")
  .attr("transform", "translate(100,100)");

这篇关于如何更改NVD3图表中的图例位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆