从phuonghuynh添加泡泡图表的详细信息

时间:2015-03-31 14:54:38

标签: javascript d3.js bubble-chart

来自phuonghuynh(http://bl.ocks.org/phuonghuynh/54a2f97950feadb45b07)的气泡图在视觉上非常吸引人,但缺少一些大中央泡沫的细节。有人知道如何在大泡沫中添加细节吗?

javascript看起来像这样:

data: {
        items: [
            {text: "Java", count: "236"},
            {text: ".Net", count: "382"},
            {text: "Php", count: "170"},
            {text: "Ruby", count: "123"},
            {text: "D", count: "12"},
            {text: "Python", count: "170"},
            {text: "C/C++", count: "382"},
            {text: "Pascal", count: "10"},
            {text: "Something", count: "170"},
        ],
        eval: function (item) {return item.count;},
        classed: function (item) {return item.text.split(" ").join("");}
    },
    plugins: [
        {
            name: "central-click",
            options: {
                text: "(See more detail)",
                style: {
                    "font-size": "12px",
                    "font-style": "italic",
                    "font-family": "Source Sans Pro, sans-serif",
                    //"font-weight": "700",
                    "text-anchor": "middle",
                    "fill": "white"
                },
                attr: {dy: "65px"},
                centralClick: function() {
                    alert("Mehr Infos");
                }
            }
        },

我想在每个气泡中添加一些额外信息,但只会在点击大气泡时显示。

0 个答案:

没有答案