【问题标题】:How to customize the tooltip in d3plus.full.js for rings?如何在 d3plus.full.js 中为环自定义工具提示?
【发布时间】:2016-07-20 00:56:29
【问题描述】:

我正在一个项目中尝试使用 d3plus 图表,在该项目中我需要自定义显示在右上角的工具提示以表示圆环。这个D3PLUS Example

我与一个额外的字段有如下联系

var connections = [ { "source": "alpha", "target": "beta", "strength": 200, "grade":"A" }, { "source": "alpha", "target": "gamma", "strength": 10, "grade": "A" }, { "source": "beta", "target": "delta", "strength": 5, "grade": "B" }, { "source": "beta", "target": "epsilon", "strength": 1.563, "grade": "B" }, { "source": "zeta", "target": "gamma", "strength": 3.125, "grade": "A" }, { "source": "theta", "target": "gamma", "strength": 0.732, "grade": "A" }, { "source": "eta", "target": "gamma", "strength": 2.063, "grade": "B" } ]

我想将grade 列为每个来源下的项目符号。

我通过对 d3plus.full.js 进行逆向工程尝试了很多,但没有成功。有没有可能?

【问题讨论】:

    标签: javascript d3plus


    【解决方案1】:

    您可以通过jquery 轻松完成。在document 准备好select .class 并添加元素。下面的例子是点击下面的按钮:

    $(document).ready(function(){
    $("#btn").on('click',function(){
            console.log("Hello");
            $(".d3plus_tooltip_focus_link").each(function (indx) {
                console.log(indx + " : " + $(this).text());
            });         
        });
    });
    

    【讨论】:

      猜你喜欢
      • 2021-02-07
      • 2010-09-21
      • 2022-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多